Parses a `NaiveDateTime` from `s`.
(s: &str)
| 452 | |
| 453 | /// Parses a `NaiveDateTime` from `s`. |
| 454 | pub 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`. |
| 463 | pub fn format_timestamp<F>(buf: &mut F, ts: &NaiveDateTime) -> Nestable |
no test coverage detected