github.com/tursom/GoCollections@v0.3.10/util/time/format.go (about) 1 package time 2 3 import ( 4 "time" 5 ) 6 7 const ( 8 Layout = time.Layout 9 ANSIC = time.ANSIC 10 UnixDate = time.UnixDate 11 RubyDate = time.RubyDate 12 RFC822 = time.RFC822 13 RFC822Z = time.RFC822Z 14 RFC850 = time.RFC850 15 RFC1123 = time.RFC1123 16 RFC1123Z = time.RFC1123Z 17 RFC3339 = time.RFC3339 18 RFC3339Nano = time.RFC3339Nano 19 Kitchen = time.Kitchen 20 // Handy time stamps. 21 Stamp = time.Stamp 22 StampMilli = time.StampMilli 23 StampMicro = time.StampMicro 24 StampNano = time.StampNano 25 DateTime = time.DateTime 26 DateOnly = time.DateOnly 27 TimeOnly = time.TimeOnly 28 ) 29 30 type ParseError = time.ParseError 31 32 func Parse(layout, value string) (Time, error) { 33 return time.Parse(layout, value) 34 } 35 36 func ParseInLocation(layout, value string, loc *Location) (Time, error) { 37 return time.ParseInLocation(layout, value, loc) 38 } 39 40 func ParseDuration(s string) (Duration, error) { 41 return time.ParseDuration(s) 42 }