📅  最后修改于: 2022-03-11 14:44:59.152000             🧑  作者: Mango
func main() {
// convert iso-8601 into rfc-3339 format
rfc3339t := strings.Replace("2015-12-23 00:00:00", " ", "T", 1) + "Z"
// parse rfc-3339 datetime
t, err := time.Parse(time.RFC3339, rfc3339t)
if err != nil {
panic(err)
}
// convert into unix time
ut := t.UnixNano() / int64(time.Millisecond)
fmt.Println(ut)
}