golang中对时间和日期格式处理 date format in Go golang 时间格式化文档time constants 1 2 3 4 5 6 7 time.Now().UTC().Format("2006-01-02") time.Now().UTC().Format("02/01/2006") time.Now().UTC().Format("2006-01-02 15:04:05") time.Now().UTC().Format(time.RFC3339) Parse date with a timezone 1 2 3 4 s := "2022-07-30T19:12:00+01:00" loc, _ := time.LoadLocation("Europe/Berlin") t, _ := time.ParseInLocation(time.RFC3339, s, loc) fmt.Println(t) 计