ParseDTimestamp parses and returns the *DTimestamp Datum value represented by the provided string in UTC, 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). Parts of this function ar
( ctx ParseContext, s string, precision time.Duration, )
| 2634 | // Parts of this function are inlined into ParseAndRequireStringHandler, if this |
| 2635 | // changes materially the timestamp case arms there may need to change too. |
| 2636 | func ParseDTimestamp( |
| 2637 | ctx ParseContext, s string, precision time.Duration, |
| 2638 | ) (_ *DTimestamp, dependsOnContext bool, _ error) { |
| 2639 | now := relativeParseTime(ctx) |
| 2640 | t, dependsOnContext, err := pgdate.ParseTimestampWithoutTimezone(now, dateStyle(ctx), s, dateParseHelper(ctx)) |
| 2641 | if err != nil { |
| 2642 | return nil, false, err |
| 2643 | } |
| 2644 | d, err := MakeDTimestamp(t, precision) |
| 2645 | return d, dependsOnContext, err |
| 2646 | } |
| 2647 | |
| 2648 | // AsDTimestamp attempts to retrieve a DTimestamp from an Expr, returning a DTimestamp and |
| 2649 | // a flag signifying whether the assertion was successful. The function should |
no test coverage detected
searching dependent graphs…