【发布时间】:2019-04-09 10:19:15
【问题描述】:
我想将"25-APR-2019"之类的字符串解析为time.time
我知道使用解析日期
date, err := time.Parse(layout, stringVariableForDate)
但我在https://golang.org/pkg/time/#pkg-constants中没有找到布局选项
我不能使用 JAN,因为使用这个,我收到错误:
panic: parsing time "25-APR-2019" as "02-JAN-2006": cannot parse "APR-2019" as "-JAN-"
如何在 go-lang 中解析月份名称为大写字母的日期字符串?
【问题讨论】: