files/en-us/web/http/reference/headers/date/index.md
The HTTP Date {{Glossary("request header", "request")}} and {{Glossary("response header")}} contains the date and time at which the message originated.
Date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
<day-name>
Mon, Tue, Wed, Thu, Fri, Sat, or Sun (case-sensitive).<day>
<month>
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec (case sensitive).<year>
<hour>
<minute>
<second>
The following HTTP message is a successful 200 status, with a Date header showing the time the message originated.
Other headers are omitted for brevity:
HTTP/1.1 200
Content-Type: text/html
Date: Tue, 29 Oct 2024 16:56:32 GMT
<html lang="en-US" …
The Date header is a {{Glossary("Forbidden request header")}}, so this code cannot set the message Date field:
fetch("https://httpbin.org/get", {
headers: {
Date: new Date().toUTCString(),
},
});
{{Specifications}}
{{Compat}}