MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_timestamp

Function parse_timestamp

src/repr/src/strconv.rs:454–460  ·  view source on GitHub ↗

Parses a `NaiveDateTime` from `s`.

(s: &str)

Source from the content-addressed store, hash-verified

452
453/// Parses a `NaiveDateTime` from `s`.
454pub fn parse_timestamp(s: &str) -> Result<CheckedTimestamp<NaiveDateTime>, ParseError> {
455 match parse_timestamp_string(s) {
456 Ok((date, time, _)) => CheckedTimestamp::from_timestamplike(date.and_time(time))
457 .map_err(|_| ParseError::out_of_range("timestamp", s)),
458 Err(e) => Err(ParseError::invalid_input_syntax("timestamp", s).with_details(e)),
459 }
460}
461
462/// Writes a [`NaiveDateTime`] timestamp to `buf`.
463pub fn format_timestamp<F>(buf: &mut F, ts: &NaiveDateTime) -> Nestable

Callers 4

callMethod · 0.85
decode_textMethod · 0.85
decode_text_into_rowMethod · 0.85
evalMethod · 0.85

Calls 2

parse_timestamp_stringFunction · 0.85
with_detailsMethod · 0.80

Tested by

no test coverage detected