[][src]Function mailparse::dateparse

pub fn dateparse(date: &str) -> Result<i64, &'static str>

Convert a date field from an email header into a UNIX epoch timestamp. This function handles the most common formatting of date fields found in email headers. It may fail to parse some of the more creative formattings.

Examples

    use mailparse::dateparse;
    assert_eq!(dateparse("Sun, 02 Oct 2016 07:06:22 -0700 (PDT)").unwrap(), 1475417182);