项目中使用,碰到字符串转时间戳的错误:
tm, err := time.Parse("2006-01-02 03:04:05", job.CreateTime)
报错:parsing time "2017-07-27 13:57:17": hour out of range
将 "2006-01-02 03:04:05" 改为 "2006-01-02 15:04:05"即可
本文共 234 字,大约阅读时间需要 1 分钟。
项目中使用,碰到字符串转时间戳的错误:
tm, err := time.Parse("2006-01-02 03:04:05", job.CreateTime)
报错:parsing time "2017-07-27 13:57:17": hour out of range
将 "2006-01-02 03:04:05" 改为 "2006-01-02 15:04:05"即可
转载于:https://my.oschina.net/wayhk/blog/1491564