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

Function stripTimezone

postgres/parser/pgdate/field_extract.go:720–724  ·  view source on GitHub ↗

stropTimezone converts the given time to a time that looks the same but is in UTC, e.g. from 2020-06-26 01:02:03 +0200 CEST to 2020-06-27 01:02:03 +0000 UTC. Note that the two times don't represent the same time instant.

(t time.Time)

Source from the content-addressed store, hash-verified

718//
719// Note that the two times don't represent the same time instant.
720func stripTimezone(t time.Time) time.Time {
721 _, offset := t.Zone()
722 t = t.Add(time.Duration(offset) * time.Second).UTC()
723 return t
724}
725
726// MakeTimestamp returns a time.Time containing all extracted information.
727func (fe *fieldExtract) MakeTimestamp() time.Time {

Callers 2

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected