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

Method MakeTimestamp

postgres/parser/pgdate/field_extract.go:727–741  ·  view source on GitHub ↗

MakeTimestamp returns a time.Time containing all extracted information.

()

Source from the content-addressed store, hash-verified

725
726// MakeTimestamp returns a time.Time containing all extracted information.
727func (fe *fieldExtract) MakeTimestamp() time.Time {
728 if fe.sentinel != nil {
729 return *fe.sentinel
730 }
731
732 year, _ := fe.Get(fieldYear)
733 month, _ := fe.Get(fieldMonth)
734 day, _ := fe.Get(fieldDay)
735 hour, _ := fe.Get(fieldHour)
736 min, _ := fe.Get(fieldMinute)
737 sec, _ := fe.Get(fieldSecond)
738 nano, _ := fe.Get(fieldNanos)
739
740 return time.Date(year, time.Month(month), day, hour, min, sec, nano, fe.MakeLocation())
741}
742
743// MakeTimestampWithoutTimezone returns a time.Time containing all extracted
744// information, minus any timezone information (which is stripped). The returned

Callers 2

MakeTimeMethod · 0.95
ParseTimestampFunction · 0.95

Calls 2

GetMethod · 0.95
MakeLocationMethod · 0.95

Tested by

no test coverage detected