diff --git a/049-enumerable.go b/049-enumerable.go index bc76c37..2d0cc5c 100644 --- a/049-enumerable.go +++ b/049-enumerable.go @@ -1,4 +1,4 @@ -package main +package main import ("fmt"; "strings") diff --git a/051-epoch.go b/051-epoch.go index 9df4fdc..44f1ea0 100644 --- a/051-epoch.go +++ b/051-epoch.go @@ -1,13 +1,20 @@ -package main - -import ("time"; "fmt") +package main // Use `time.Now` with `Unix` or `UnixNane` to get + // elapsed time since the Unix epoch. +import "time" 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) + millis := nanos / 1000000 // There is no `UnixMillis`. + println("Secs: ", secs) + println("Millis:", millis) + println("Nanos: ", nanos) } + +/* +$ go run 051-epoch.go +Secs: 1348240948 +Millis: 1348240948517 +Nanos: 1348240948517870000 +*/