DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending.
(b []byte)
| 990 | |
| 991 | // DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending. |
| 992 | func DecodeTimeTZDescending(b []byte) ([]byte, timetz.TimeTZ, error) { |
| 993 | b, unixMicros, offsetSecs, err := decodeTimeTZ(b) |
| 994 | if err != nil { |
| 995 | return nil, timetz.TimeTZ{}, err |
| 996 | } |
| 997 | // Do not use timeofday.FromInt, as it loses 24:00:00 encoding. |
| 998 | return b, timetz.TimeTZ{ |
| 999 | TimeOfDay: timeofday.TimeOfDay(^unixMicros - int64(^offsetSecs)*offsetSecsToMicros), |
| 1000 | OffsetSecs: ^offsetSecs, |
| 1001 | }, nil |
| 1002 | } |
| 1003 | |
| 1004 | func decodeTimeTZ(b []byte) ([]byte, int64, int32, error) { |
| 1005 | if PeekType(b) != TimeTZ { |
no test coverage detected
searching dependent graphs…