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

Function DecodeTimeTZAscending

pkg/util/encoding/encoding.go:979–989  ·  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

977// using encodeTimeTZ. The remainder of the input buffer and the decoded
978// timetz.TimeTZ are returned.
979func DecodeTimeTZAscending(b []byte) ([]byte, timetz.TimeTZ, error) {
980 b, unixMicros, offsetSecs, err := decodeTimeTZ(b)
981 if err != nil {
982 return nil, timetz.TimeTZ{}, err
983 }
984 // Do not use timeofday.FromInt, as it loses 24:00:00 encoding.
985 return b, timetz.TimeTZ{
986 TimeOfDay: timeofday.TimeOfDay(unixMicros - int64(offsetSecs)*offsetSecsToMicros),
987 OffsetSecs: offsetSecs,
988 }, nil
989}
990
991// DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending.
992func 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…