go time笔记

package main

import (
  "time"
  "fmt"
)

func main() {
  t := time.Now().UnixNano()
  fmt.Println(t)

  t2 := time.Unix(0,t)
  fmt.Println(t2)

  t3 := time.Unix(100,t)
  fmt.Println(t3)
}

 

go time package provides support of time. The operating system supports two clocks. One is wall clock, providing time stamp. The other is monotonic clock. The latter one is ususlly used to measure a duration. This is an example for conversion between int64 and time object.

posted on 2018-11-27 05:21  Kinsang  阅读(114)  评论(0编辑  收藏  举报

导航