MCPcopy Create free account
hub / github.com/dolthub/doltgresql / FixedOffsetTimeZoneToLocation

Function FixedOffsetTimeZoneToLocation

postgres/parser/timetz/timetz.go:249–253  ·  view source on GitHub ↗

FixedOffsetTimeZoneToLocation creates a time.Location with a set offset and with a name that can be marshaled by crdb between nodes.

(offset int, origRepr string)

Source from the content-addressed store, hash-verified

247// FixedOffsetTimeZoneToLocation creates a time.Location with a set offset and
248// with a name that can be marshaled by crdb between nodes.
249func FixedOffsetTimeZoneToLocation(offset int, origRepr string) *time.Location {
250 return time.FixedZone(
251 fmt.Sprintf("%s%d (%s)", fixedOffsetPrefix, offset, origRepr),
252 offset)
253}
254
255// currentDateAsPrefix will allow the timetz value to have the current time zone
256// rather than timezone of 1970-01-01 in cases of timezone undefined.

Callers 1

ToTimeMethod · 0.85

Calls 1

FixedZoneMethod · 0.80

Tested by

no test coverage detected