Function parse_with_preference_and_timezone

Source
pub fn parse_with_preference_and_timezone<Tz2: TimeZone>(
    input: &str,
    dmy_preference: bool,
    tz: &Tz2,
) -> Result<DateTime<Utc>>
Expand description

Similar to parse(), this function takes a datetime string and a boolean dmy_preference and a timezone. When timezone is not given in the input string, this function will assume and parse the datetime by the custom timezone provided in this function’s arguments. When dmy_preference is true, it will parse strings using the DMY format. Otherwise, it parses them using an MDY format.