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)
| 1460 | // using encodeTimeTZ. The remainder of the input buffer and the decoded |
| 1461 | // timetz.TimeTZ are returned. |
| 1462 | func DecodeTimeTZAscending(b []byte) ([]byte, timetz.TimeTZ, error) { |
| 1463 | b, unixMicros, offsetSecs, err := decodeTimeTZ(b) |
| 1464 | if err != nil { |
| 1465 | return nil, timetz.TimeTZ{}, err |
| 1466 | } |
| 1467 | // Do not use timeofday.FromInt, as it loses 24:00:00 encoding. |
| 1468 | return b, timetz.TimeTZ{ |
| 1469 | TimeOfDay: timeofday.TimeOfDay(unixMicros - int64(offsetSecs)*offsetSecsToMicros), |
| 1470 | OffsetSecs: offsetSecs, |
| 1471 | }, nil |
| 1472 | } |
| 1473 | |
| 1474 | // DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending. |
| 1475 | func DecodeTimeTZDescending(b []byte) ([]byte, timetz.TimeTZ, error) { |
no test coverage detected
searching dependent graphs…