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

Function MakeDTimestampTZ

postgres/parser/sem/tree/datum.go:1071–1077  ·  view source on GitHub ↗

MakeDTimestampTZ creates a DTimestampTZ with specified precision.

(t time.Time, precision time.Duration)

Source from the content-addressed store, hash-verified

1069
1070// MakeDTimestampTZ creates a DTimestampTZ with specified precision.
1071func MakeDTimestampTZ(t time.Time, precision time.Duration) (*DTimestampTZ, error) {
1072 ret := t.Round(precision)
1073 if ret.After(MaxSupportedTime) || ret.Before(MinSupportedTime) {
1074 return nil, errors.Newf("timestamp %q exceeds supported timestamp bounds", ret.Format(time.RFC3339))
1075 }
1076 return &DTimestampTZ{Time: ret}, nil
1077}
1078
1079// MustMakeDTimestampTZ wraps MakeDTimestampTZ but panics if there is an error.
1080// This is intended for testing applications only.

Callers 3

MustMakeDTimestampTZFunction · 0.85
ParseDTimestampTZFunction · 0.85
RoundMethod · 0.85

Calls 4

AfterMethod · 0.80
BeforeMethod · 0.80
FormatMethod · 0.65
RoundMethod · 0.45

Tested by

no test coverage detected