ParseTime parse an RFC3339 string with nanoseconds
(timeStr string)
| 31 | |
| 32 | // ParseTime parse an RFC3339 string with nanoseconds |
| 33 | func ParseTime(timeStr string) (time.Time, error) { |
| 34 | out, err := time.Parse(time.RFC3339Nano, timeStr) |
| 35 | if err != nil { |
| 36 | out, err = time.Parse(TimeFormat, timeStr) |
| 37 | } |
| 38 | return out, err |
| 39 | } |
| 40 | |
| 41 | // Time is just a time.Time with a JSON serialization |
| 42 | type Time struct { |