Skip to main content

now_date

Function now_date 

Source
pub fn now_date() -> HttpDate
Available on crate feature std only.
Expand description

The current time as a Date value, from a per-thread DateCache: the system clock is read on every call, the value is reformatted only when the second changes. Connection::respond and Server write it on every response that did not set its own date.

ยงExamples

let date = http_net::blocking::now_date();
assert_eq!(date.as_bytes().len(), 29);
assert!(date.as_str().ends_with(" GMT"));