码迷,mamicode.com
首页 > 其他好文 > 详细

Go time.Time string int各种格式转换

时间:2019-07-17 10:51:49      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:parse   备份   format   inpu   style   bsp   color   int   col   

太短小在这里备份

 

1. time.Time to string

format string : "2006-01-02 15:04:05.999999999 -0700 MST"

t.Format("2006-01-02")

2. time format string to int

time.Parse("2006-01-02", input)

3. yyyy-mm-dd string to yyyymmdd string

strings.Replace(input, "-", "", -1)

 

Go time.Time string int各种格式转换

标签:parse   备份   format   inpu   style   bsp   color   int   col   

原文地址:https://www.cnblogs.com/GW977/p/11199439.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!