22 lines
330 B
Go
22 lines
330 B
Go
// ## Time
|
|
|
|
package main
|
|
|
|
import "time"
|
|
import "fmt"
|
|
|
|
func main() {
|
|
now := time.Now()
|
|
fmt.Println(now)
|
|
|
|
then := time.Date(2009, 11, 17, 20, 34, 58, 651387237, time.UTC)
|
|
fmt.Println(then)
|
|
|
|
diff := now.Sub(then)
|
|
fmt.Println(diff)
|
|
}
|
|
|
|
// todo: extract parts
|
|
// todo: add duration
|
|
// todo: check before / after
|