golang中time类型的这个是什么意思?

ddxx11223 · 2017-11-18 10:18:50 · 4329 次点击 · 大约8小时之前 开始浏览    置顶
这是一个创建于 2017-11-18 10:18:50 的主题,其中的信息可能已经有所发展或是发生改变。

fmt.Println(time.Now())
打印结果:2017-11-18 16:36:41.8491739 +0800 CST m=+0.008006700

上面的m=+0.008006700 是什么意思?我该如何去掉,只需要我的time实例能打印到CST为止


有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

4329 次点击  
加入收藏 微博
4 回复  |  直到 2017-11-18 12:17:00
tk103331
tk103331 · #1 · 7年之前

试试

time.Now().Format("2017-11-18 16:36:41.8491739 +0800")
ddxx11223
ddxx11223 · #2 · 7年之前
tk103331tk103331 #1 回复

试试 ``` time.Now().Format("2017-11-18 16:36:41.8491739 +0800") ```

"2006-01-02 15:04:05.0000000 -0700 MST" 用这个模板是可以的,但是m=+0.008006700 到底是啥东西

tk103331
tk103331 · #3 · 7年之前

If the time has a monotonic clock reading, the returned string includes a final field "m=±<value>", where value is the monotonic clock reading formatted as a decimal number of seconds.

不太理解这句话

http://docs.studygolang.com/pkg/time/#Time.String

ddxx11223
ddxx11223 · #4 · 7年之前
tk103331tk103331 #3 回复

If the time has a monotonic clock reading, the returned string includes a final field "m=±", where value is the monotonic clock reading formatted as a decimal number of seconds. 不太理解这句话 http://docs.studygolang.com/pkg/time/#Time.String

查了一下,好像是什么相对时间,用于程序调试用?我也不是太明白

添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传