How to parse date/time of the following format?

huangapple go评论80阅读模式
英文:

How to parse date/time of the following format?

问题

我有以下格式的时间字符串:

November 05, 2016, 01:02:31 PM

有人知道如何将它们解析为 Golang 的 Time 类型吗?

英文:

I have time strings of the following format

November 05, 2016, 01:02:31 PM

Does any one know how can I parse them into golang Time?

答案1

得分: 4

以下是要翻译的内容:

https://golang.org/pkg/time/#Parse

time.Parse(`January 02, 2006, 15:04:05 PM`, `November 05, 2016, 01:02:31 PM`)

https://play.golang.org/p/LOD5D-8i_U

翻译结果:

https://golang.org/pkg/time/#Parse

time.Parse(`January 02, 2006, 15:04:05 PM`, `November 05, 2016, 01:02:31 PM`)

https://play.golang.org/p/LOD5D-8i_U

英文:

https://golang.org/pkg/time/#Parse

time.Parse(`January 02, 2006, 15:04:05 PM`, `November 05, 2016, 01:02:31 PM`)

https://play.golang.org/p/LOD5D-8i_U

huangapple
  • 本文由 发表于 2016年11月13日 15:53:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/40571711.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定