MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / ParseDTimeTZ

Function ParseDTimeTZ

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

ParseDTimeTZ parses and returns the *DTime Datum value represented by the provided string, or an error if parsing is unsuccessful. The dependsOnContext return value indicates if we had to consult the ParseContext (either for the time or the local timezone).

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

Source from the content-addressed store, hash-verified

2457// The dependsOnContext return value indicates if we had to consult the
2458// ParseContext (either for the time or the local timezone).
2459func ParseDTimeTZ(
2460 ctx ParseContext, s string, precision time.Duration,
2461) (_ *DTimeTZ, dependsOnContext bool, _ error) {
2462 now := relativeParseTime(ctx)
2463 d, dependsOnContext, err := timetz.ParseTimeTZ(now, dateStyle(ctx), s, precision)
2464 if err != nil {
2465 return nil, false, err
2466 }
2467 return NewDTimeTZ(d), dependsOnContext, nil
2468}
2469
2470// ResolvedType implements the TypedExpr interface.
2471func (*DTimeTZ) ResolvedType() *types.T {

Callers 1

ParseAndRequireStringFunction · 0.85

Calls 4

ParseTimeTZFunction · 0.92
relativeParseTimeFunction · 0.85
dateStyleFunction · 0.85
NewDTimeTZFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…