英文:
How can I parse this date in Golang?
问题
我在解析这个日期("APR 19, 3:15p ET")时遇到了一些问题,有人可以帮我吗?
这是我写的代码。
d, err := time.Parse("JAN 02, 3:04p ET", date)
提前感谢。
英文:
I am having some trouble in parsing this date ("APR 19, 3:15p ET"), can anyone please help me in this regard?
This is the code which I have written.
d, err := time.Parse("JAN 02, 3:04p ET", date)
Thanks in advance.
答案1
得分: 1
3个字母的月份常量是Jan
日期 := "APR 19, 3:15p ET"
d, err := time.Parse("Jan 02, 3:04p ET", date)
http://play.golang.org/p/LkeQOtc1Hd
英文:
The 3 letter month constant is Jan
date := "APR 19, 3:15p ET"
d, err := time.Parse("Jan 02, 3:04p ET", date)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论