go get various timestamps

Easy to understand and use directly

fmt.Println(“Seconds:”, time.Now().Unix())
fmt.Println(“Nanoseconds:”, time.Now().UnixNano())
fmt.Println(“milliseconds:”, time.Now().UnixNano()/1e6)
fmt.Println(“Millisecond value:”, (time.Now().UnixNano()/1e6)-(time.Now().Unix()*1000))

timestamp (seconds): 1628337854;
Timestamp (nanoseconds): 1628337854583914000;
timestamp (milliseconds): 1628337854583;
timestamp (millisecond value): 583;

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish