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

Function EncodeTimeTZAscending

pkg/util/encoding/encoding.go:958–961  ·  view source on GitHub ↗

EncodeTimeTZAscending encodes a timetz.TimeTZ value and appends it to the supplied buffer and returns the final buffer. The encoding is guaranteed to be ordered such that if t1.Before(t2) then after encodeTimeTZ(b1, t1) and encodeTimeTZ(b2, t2), Compare(b1, b2) < 0. The time zone offset is included

(b []byte, t timetz.TimeTZ)

Source from the content-addressed store, hash-verified

956// Compare(b1, b2) < 0.
957// The time zone offset is included in the encoding.
958func EncodeTimeTZAscending(b []byte, t timetz.TimeTZ) []byte {
959 // Do not use TimeOfDay's add function, as it loses 24:00:00 encoding.
960 return encodeTimeTZ(b, int64(t.TimeOfDay)+int64(t.OffsetSecs)*offsetSecsToMicros, t.OffsetSecs)
961}
962
963// EncodeTimeTZDescending is the descending version of EncodeTimeTZAscending.
964func EncodeTimeTZDescending(b []byte, t timetz.TimeTZ) []byte {

Callers

nothing calls this directly

Calls 1

encodeTimeTZFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…