Module http_date
Available on crate features
http and std only.Expand description
RFC 9110 §5.6.7 HTTP-dates as unix seconds.
Formats IMF-fixdate (Sun, 06 Nov 1994 08:49:37 GMT) and parses it plus the two obsolete
forms a recipient must accept: RFC 850 (Sunday, 06-Nov-94 08:49:37 GMT) and asctime
(Sun Nov 6 08:49:37 1994).
Constants§
- HTTP_
DATE_ LEN - Byte length of every IMF-fixdate.
- MAX_
HTTP_ DATE_ UNIX_ SECS Fri, 31 Dec 9999 23:59:59 GMT, the last second an HTTP-date can represent.
Functions§
- format_
http_ date - Format
unix_secsas an IMF-fixdate; values pastMAX_HTTP_DATE_UNIX_SECSclamp to it. - format_
http_ date_ bytes - Same as
format_http_datebut returned as owned Bytes. - format_
http_ date_ bytes_ maybe_ now format_http_date_bytes, sharing the bytes offormat_http_date_now_byteswhenunix_secsis the second those were last formatted for on this thread.- format_
http_ date_ now format_http_datefor the current second of rama’s cached wall clock.- format_
http_ date_ now_ bytes format_http_date_nowas shared bytes, formatted once per second per thread.- parse_
http_ date - Unix seconds of an IMF-fixdate, RFC 850 or asctime HTTP-date, ignoring surrounding OWS.