Skip to main content

try_to_parse_datetime_from_string

Function try_to_parse_datetime_from_string 

Source
pub fn try_to_parse_datetime_from_string<S, Formats, Format>(
    s: S,
    fmts: Formats,
) -> Option<NaiveDateTime>
where S: AsRef<str>, Formats: Iterator<Item = Format>, Format: AsRef<str>,
Expand description

Try to parse s with all formats from fmts

The function returns an Option<NaiveDateTime>, so that the user of the function can generate the appropriate error message themselves.