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

Function DecodeTimeTZAscending

pkg/util/encoding/encoding.go:1462–1472  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1460// using encodeTimeTZ. The remainder of the input buffer and the decoded
1461// timetz.TimeTZ are returned.
1462func 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.
1475func DecodeTimeTZDescending(b []byte) ([]byte, timetz.TimeTZ, error) {

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…