DecodeTimeTZAscending decodes a timetz.TimeTZ value which was encoded using encodeTimeTZ. The remainder of the input buffer and the decoded timetz.TimeTZ are returned.
(b []byte)
| 977 | // using encodeTimeTZ. The remainder of the input buffer and the decoded |
| 978 | // timetz.TimeTZ are returned. |
| 979 | func DecodeTimeTZAscending(b []byte) ([]byte, timetz.TimeTZ, error) { |
| 980 | b, unixMicros, offsetSecs, err := decodeTimeTZ(b) |
| 981 | if err != nil { |
| 982 | return nil, timetz.TimeTZ{}, err |
| 983 | } |
| 984 | // Do not use timeofday.FromInt, as it loses 24:00:00 encoding. |
| 985 | return b, timetz.TimeTZ{ |
| 986 | TimeOfDay: timeofday.TimeOfDay(unixMicros - int64(offsetSecs)*offsetSecsToMicros), |
| 987 | OffsetSecs: offsetSecs, |
| 988 | }, nil |
| 989 | } |
| 990 | |
| 991 | // DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending. |
| 992 | func DecodeTimeTZDescending(b []byte) ([]byte, timetz.TimeTZ, error) { |
no test coverage detected
searching dependent graphs…