MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / ParseDTimestampTZ

Function ParseDTimestampTZ

pkg/sql/sem/tree/datum.go:2369–2379  ·  view source on GitHub ↗

ParseDTimestampTZ parses and returns the *DTimestampTZ Datum value represented by the provided string in the provided location, or an error if parsing is unsuccessful.

(
	ctx ParseTimeContext, s string, precision time.Duration,
)

Source from the content-addressed store, hash-verified

2367// ParseDTimestampTZ parses and returns the *DTimestampTZ Datum value represented by
2368// the provided string in the provided location, or an error if parsing is unsuccessful.
2369func ParseDTimestampTZ(
2370 ctx ParseTimeContext, s string, precision time.Duration,
2371) (*DTimestampTZ, error) {
2372 now := relativeParseTime(ctx)
2373 t, err := pgdate.ParseTimestamp(now, pgdate.ParseModeYMD, s)
2374 if err != nil {
2375 return nil, err
2376 }
2377 // Always normalize time to the current location.
2378 return MakeDTimestampTZ(t, precision), nil
2379}
2380
2381var dMinTimestampTZ = &DTimestampTZ{}
2382

Callers 2

ParseAndRequireStringFunction · 0.85
PerformCastFunction · 0.85

Calls 3

ParseTimestampFunction · 0.92
relativeParseTimeFunction · 0.85
MakeDTimestampTZFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…