2018-12-17 12:55:50 +0300请帮我像在 golang 中一样解析日期
我正在尝试布局
layout := "2006-01-02 15:04:05 +0000"
dateString := "2018-12-17 12:55:50 +0300"
t, err := time.Parse(layout, dateString)
if err != nil {
fmt.Println("Error while parsing date :", err)
}
fmt.Println(t.Format("2006-01-02 15:04:05"))
但是编译器说Error while parsing date : parsing time "2018-12-17 12:55:50 +0300" as "2006-01-02 15:04:05 +0000": cannot parse "300" as " +0000"
鸿蒙传说
相关分类