-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
84 lines (68 loc) · 1.7 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
title: Date
slug: Web/HTTP/Headers/Date
page-type: http-header
browser-compat: http.headers.Date
---
{{HTTPSidebar}}
The **`Date`** general HTTP header contains the date and time
at which the message originated.
> **Warning:** `Date` is listed
> in the [forbidden header names](https://fetch.spec.whatwg.org/#forbidden-header-name)
> in the fetch spec, so this code will not send the `Date` header:
>
> ```js
> fetch("https://httpbin.org/get", {
> headers: {
> Date: new Date().toUTCString(),
> },
> });
> ```
<table class="properties">
<tbody>
<tr>
<th scope="row">Header type</th>
<td>
{{Glossary("Request header")}},
{{Glossary("Response header")}}
</td>
</tr>
<tr>
<th scope="row">{{Glossary("Forbidden header name")}}</th>
<td>yes</td>
</tr>
</tbody>
</table>
## Syntax
```http
Date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
```
## Directives
- \<day-name>
- : One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive).
- \<day>
- : 2 digit day number, e.g. "04" or "23".
- \<month>
- : One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
"Nov", "Dec" (case sensitive).
- \<year>
- : 4 digit year number, e.g. "1990" or "2016".
- \<hour>
- : 2 digit hour number, e.g. "09" or "23".
- \<minute>
- : 2 digit minute number, e.g. "04" or "59".
- \<second>
- : 2 digit second number, e.g. "04" or "59".
- GMT
- : Greenwich Mean Time. HTTP dates are always expressed in GMT, never in local
time.
## Examples
```http
Date: Wed, 21 Oct 2015 07:28:00 GMT
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{HTTPHeader("Age")}}