gobyexample/051-epoch.go
Mark McGranaghan 354a9d862f reorder
2012-09-21 07:54:20 -07:00

14 lines
277 B
Go

package main
import ("time"; "fmt")
func main() {
now := time.Now()
secs := now.Unix()
nanos := now.UnixNano()
millis := nanos / 1000000
fmt.Println("Seconds since epoch:", secs)
fmt.Println("Millis since epoch:", millis)
fmt.Println("Nanos since epoch:", nanos)
}