Skip to main content

parse_http_date

Parse a date format as specified by HTTP RFC 9110 Section 5.6.7.

The three formats allowed by the RFC are accepted, even if only the first one is still in widespread use.

Return an integer expressed in seconds since the epoch, in UTC.

def parse_http_date(
date: string
) - > integer

Parse a date format as specified by HTTP RFC 9110 Section 5.6.7. The three formats allowed by the RFC are accepted, even if only the first one is still in widespread use.

Parameters

NameTypeDescription
datestringThe HTTP date string to be parsed, supporting RFC 1123, RFC 850, and asctime formats.

Returns

TypeDescription
integerAn integer expressed in seconds since the epoch, in UTC.