如何用点/句点解析日期/时间字符串01.08.2022 17:00:02
package main
import "fmt"
import "time"
func main() {
date, err := time.Parse("2.Jan.2006 15:04:05", "01.08.2022 17:00:02")
if err != nil {
panic(err)
}
fmt.Println(date)
}
这导致panic: parsing time "01.08.2022 17:00:02" as "2.Jan.2006 15:04:05": cannot parse "08.2022 17:00:02" as "Jan"
小怪兽爱吃肉
相关分类