updatges
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package main
|
||||
|
||||
import ("time"; "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
|
||||
// add duration
|
||||
// check before / after
|
||||
21
091-time/time.go
Normal file
21
091-time/time.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// ## 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
|
||||
4
091-time/time.sh
Normal file
4
091-time/time.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
$ go run time.go
|
||||
2012-09-23 11:28:59.551605 -0700 PDT
|
||||
2009-11-17 20:34:58.651387237 +0000 UTC
|
||||
24981h54m0.900217763s
|
||||
Reference in New Issue
Block a user