Skip to main content

parse_http_date

Function parse_http_date 

Source
pub fn parse_http_date(text: &str) -> Result<i64, DateTimeError>
Expand description

Parse an HTTP-date (RFC 9110 5.6.7) to Unix microseconds: the preferred IMF-fixdate and the two obsolete forms a recipient must still accept, the RFC 850 form (two-digit years follow jiff’s POSIX window: 69-99 are 19xx, 00-68 are 20xx, so no clock is needed) and the asctime form (always UTC). Resolution is whole seconds. Used for the Date and Retry-After headers.

§Errors

DateTimeError::HttpDate when text is not a date.