golang学习之奇葩的time format

golang格式化时间时,比如如下格式进行格式化输出:

fmt.Println(time.Now().Format("2007年03月"))

程序直接输出:

16007年02月

很奇葩,但是若改成:

fmt.Println(time.Now().Format("2006年01月"))

程序正确输出:

2016年06月

据说是go诞生日期,只认这个,更详细的时间是:

fmt.Println(time.Now().Format("2006-01-02 15:04:05"))
2016-06-16 14:18:17
原文地址:https://www.cnblogs.com/vipzhou/p/5590854.html