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

Function EncodeTimeTZAscending

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

1439// Compare(b1, b2) < 0.
1440// The time zone offset is included in the encoding.
1441func EncodeTimeTZAscending(b []byte, t timetz.TimeTZ) []byte {
1442 // Do not use TimeOfDay's add function, as it loses 24:00:00 encoding.
1443 return encodeTimeTZ(b, int64(t.TimeOfDay)+int64(t.OffsetSecs)*offsetSecsToMicros, t.OffsetSecs)
1444}
1445
1446// EncodeTimeTZDescending is the descending version of EncodeTimeTZAscending.
1447func 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…