1 2 3 4 5 6 7 月日时分秒年时区
标准以这个对应
const ( 43 ANSIC = "Mon Jan _2 15:04:05 2006" 44 UnixDate = "Mon Jan _2 15:04:05 MST 2006" 45 RubyDate = "Mon Jan 02 15:04:05 -0700 2006" 46 RFC822 = "02 Jan 06 15:04 MST" 47 RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone 48 RFC850 = "Monday, 02-Jan-06 15:04:05 MST" 49 RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" 50 RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone 51 RFC3339 = "2006-01-02T15:04:05Z07:00" 52 RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00" 53 Kitchen = "3:04PM" 54 // Handy time stamps. 55 Stamp = "Jan _2 15:04:05" 56 StampMilli = "Jan _2 15:04:05.000" 57 StampMicro = "Jan _2 15:04:05.000000" 58 StampNano = "Jan _2 15:04:05.000000000" 59 )
包里面带了常用的标准
t, _ := time.Parse(withNanos, "2013-10-05 18:30:50")
用这个就能解析时间了
有疑问加站长微信联系(非本文作者)