MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / DecodeTimeTZDescending

Function DecodeTimeTZDescending

pkg/util/encoding/encoding.go:1475–1485  ·  view source on GitHub ↗

DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending.

(b []byte)

Source from the content-addressed store, hash-verified

1473
1474// DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending.
1475func 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
1487func decodeTimeTZ(b []byte) ([]byte, int64, int32, error) {
1488 if PeekType(b) != TimeTZ {

Callers 1

prettyPrintFirstValueFunction · 0.85

Calls 2

TimeOfDayTypeAlias · 0.92
decodeTimeTZFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…