首页 > 其他 > 详细

go time笔记

时间:2018-11-27 10:02:52      阅读:148      评论:0      收藏:0      [点我收藏+]
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.

go time笔记

原文:https://www.cnblogs.com/kinsang/p/10024143.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!