Home

Published

- 1 min read

time now golang int64

img of time now golang int64

The solution for this is noted below

time now golang int64

Solution

   now := time.Now()      // current local time
sec := now.Unix()      // number of seconds since January 1, 1970 UTC
nsec := now.UnixNano() // number of nanoseconds since January 1, 1970 UTC

fmt.Println(now)  // time.Time
fmt.Println(sec)  // int64
fmt.Println(nsec) // int64

Try other methods by searching on the site. That is if this doesn’t work