DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending.
(b []byte)
| 1473 | |
| 1474 | // DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending. |
| 1475 | func DecodeTimeTZDescending(b []byte) ([]byte, timetz.TimeTZ, error) { |
| 1476 | b, unixMicros, offsetSecs, err := decodeTimeTZ(b) |
| 1477 | if err != nil { |
| 1478 | return nil, timetz.TimeTZ{}, err |
| 1479 | } |
| 1480 | // Do not use timeofday.FromInt, as it loses 24:00:00 encoding. |
| 1481 | return b, timetz.TimeTZ{ |
| 1482 | TimeOfDay: timeofday.TimeOfDay(^unixMicros - int64(^offsetSecs)*offsetSecsToMicros), |
| 1483 | OffsetSecs: ^offsetSecs, |
| 1484 | }, nil |
| 1485 | } |
| 1486 | |
| 1487 | func decodeTimeTZ(b []byte) ([]byte, int64, int32, error) { |
| 1488 | if PeekType(b) != TimeTZ { |
no test coverage detected
searching dependent graphs…