fn parse_timestamp(s: &str) -> Result<DateTime<Utc>, Error> {
    for format in TIMESTAMP_FORMATS {
        if let Ok(result) = Local.datetime_from_str(s, format) {
            return Ok(datetime_to_utc(result));
        }
    }
    for format in TIMESTAMP_UTC_FORMATS {
        if let Ok(result) = Utc.datetime_from_str(s, format) {
            return Ok(result);
        }
    }
    if let Ok(result) = DateTime::parse_from_rfc3339(s) {
        return Ok(datetime_to_utc(result));
    }
    if let Ok(result) = DateTime::parse_from_rfc2822(s) {
        return Ok(datetime_to_utc(result));
    }
    for format in TIMESTAMP_TZ_FORMATS {
        if let Ok(result) = DateTime::parse_from_str(s, format) {
            return Ok(datetime_to_utc(result));
        }
    }
    Err(Error::AutoTimestampParseError { s: s.into() })
}
/// Parse a string into a timestamp using one of a set of formats
Parse a string into a timestamp using one of a set of formats
Parse a string into a timestamp using one of a set of formats
fn parse_timestamp(s: &str) -> Result<DateTime<Utc>, Error> {
    for format in TIMESTAMP_FORMATS {
        if let Ok(result) = Local.datetime_from_str(s, format) {
            return Ok(datetime_to_utc(result));
        }
    }
    for format in TIMESTAMP_UTC_FORMATS {
        if let Ok(result) = Utc.datetime_from_str(s, format) {
            return Ok(result);
        }
    }
    if let Ok(result) = DateTime::parse_from_rfc3339(s) {
        return Ok(datetime_to_utc(result));
    }
    if let Ok(result) = DateTime::parse_from_rfc2822(s) {
        return Ok(datetime_to_utc(result));
    }
    for format in TIMESTAMP_TZ_FORMATS {
        if let Ok(result) = DateTime::parse_from_str(s, format) {
            return Ok(datetime_to_utc(result));
        }
    }
    Err(Error::AutoTimestampParseError { s: s.into() })
}
fn parse_timestamp ( s : & str ) -> Result < DateTime < Utc > , Error > { for format in TIMESTAMP_FORMATS { if let Ok ( result ) = Local . datetime_from_str ( s , format ) { return Ok ( datetime_to_utc ( result ) ) ; } } for format in TIMESTAMP_UTC_FORMATS { if let Ok ( result ) = Utc . datetime_from_str ( s , format ) { return Ok ( result ) ; } } if let Ok ( result ) = DateTime :: parse_from_rfc3339 ( s ) { return Ok ( datetime_to_utc ( result ) ) ; } if let Ok ( result ) = DateTime :: parse_from_rfc2822 ( s ) { return Ok ( datetime_to_utc ( result ) ) ; } for format in TIMESTAMP_TZ_FORMATS { if let Ok ( result ) = DateTime :: parse_from_str ( s , format ) { return Ok ( datetime_to_utc ( result ) ) ; } } Err ( Error :: AutoTimestampParseError { s : s . into ( ) } ) }
Parse a string into a timestamp using one of a set of formats
Parse a string into a timestamp using one of a set of formats
s
&str