Date:

Date: ヘッダー (電子メール、HTTP)

[5] Date: ヘッダーは、 メッセージの生成時刻を表します。

仕様書

意味

[506] HTTPDate: ヘッダーは、 メッセージ元々作成された (originate) 日時を表します >>505

[507] これは RFC 5322Date: ヘッダーと同じです >>505

[510] HTTP Date: ヘッダー生成するときは、 メッセージ生成日時を最大限近似した値を生成するべきです。 理論上は payload生成の直前の瞬間を表すべき (ought to) です。 実際上はメッセージ作成 (originate) 中のいつの時刻でもあり得ます。 >>505 現在時刻

文脈

[511] HTTP 起源サーバーは、生成の瞬間の UTC の適当な近似を得る能力を持った時計を有しない時は、 Date: ヘッダーを送信してはなりません >>505

[519] 組込み機器などで正確な時計を有しないを想定しているのでしょうが、 実際にどれくらい存在するのか不明です。 現地時刻のみで UTC との時差を知らない機器は多いでしょうが、そのような環境でとして動作するものがどれくらいあるのかは謎です。 時計がなければ TLS も実装できない気がします。

[512] HTTP 起源鯖は、 1xx5xx応答Date:生成しても構いません >>505

[513] HTTP 起源鯖はその他の場合に Date: ヘッダーを送信しなければなりません >>505

[515] HTTP 利用者エージェントは、要求Date: ヘッダーを送信しても構いません。ただしにとって有用であると信ずる場合以外は普通は送信しません。 >>505

[15] 実際に主要なHTTPクライアントDate: を送信しません。
[16] AWSWeb API のドキュメントには要求Date: ヘッダーを示しているものがあります。サーバーが実際にこれを使っているのかは不明です。

[7] 304 の項も参照。

[13] SSDP応答でも使います >>12

構文

[517] 電子メールHTTP も歴史的に同じ Date: ヘッダーから出発していますが、その後のそれぞれの仕様の改訂により現在は異なる構文となっています。

[508] HTTP では、構文は HTTPの日時形式 (HTTP-date) です >>505

処理モデル

[11] 非妥当な値の処理については、 HTTP-date を参照。

[514] 時計を有する HTTP 受信者は、 応答メッセージキャッシュしたり下流転送したりする場合、 Date: ヘッダーが含まれていなければ、 受信した時刻を記録し、 Date: ヘッダー付加 (append) しなければなりません >>505

[10] Date: ヘッダーキャッシュする応答の新旧判定や満期時刻の決定に使われます。

MSA との関係

[3] MSA は、メッセージDate: が欠けている場合、 これを追加して構いません。 また、 Date: の書式が RFC 2822適合しない場合、これを修正して構いませんRFC 4409 8.2

歴史

[1] [HTTP92] (Object Header lines in HTTP http://www.w3.org/Protocols/HTTP/Object_Headers.html#date) では Date: 欄の値は物体が作成された時間を指定するとされていました。原案ですが。

[2] >>1 この機能を持った欄は今の HTTP にはありませんね。 MIMEContent-Disposition: disposition; creation-date=date を使うという方法はあります。

[516] RFC 1945 (HTTP/1.0) 10.6; RFC 2068 (HTTP/1.1) 14.19; RFC 2616 (HTTP/1.1) 14.18 Date

The Date general-header field represents the date and time at which the message was originated, having the same semantics as orig-date in RFC 822. The field value is an HTTP-date, as described in {1945} Section 3.3 {2068} section 3.3.1; it MUST be sent in RFC 1123 [8]-date format {2616}.

Date 一般頭欄は、メッセージが起源された日時を表現します。 これは RFC822orig-date と同じ意味を持ちます。 欄値は HTTP-date です。 欄値は RFC 1123 日付書式で送信しなければなりません

  • Date = "Date" ":" HTTP-date

An example is

  • Date: Tue, 15 Nov 1994 08:12:31 GMT

{2616} Origin servers MUST include a Date header field in all responses, except in these cases:

起源サーバーは、次の場合を除いて全ての応答に Date 頭欄を含めなければなりません

  1. 1. If the response status code is 100 (Continue) or 101 (Switching Protocols), the response MAY include a Date header field, at the server's option.
  2. 2. If the response status code conveys a server error, e.g. 500 (Internal Server Error) or 503 (Service Unavailable), and it is inconvenient or impossible to generate a valid Date.
  3. 3. If the server does not have a clock that can provide a reasonable approximation of the current time, its responses MUST NOT include a Date header field. In this case, the rules in section 14.18.1 MUST be followed.
  1. 応答状態符号が 100 (継続) 又は 101 (プロトコル切り替え) であれば、応答はサーバーの任意選択によって、 Date 頭欄を含んでもかまいません
  2. 応答状態符号がサーバー誤りを伝達する場合、例えば 500 (サーバー内部誤り) や 503 (サービス利用不可能) の場合で、妥当な Date を生成するのか不便又は不可能な場合。
  3. サーバーが現在時刻の適当な近似値を提供する時計を持たない場合、 その応答は Date 頭欄を含んでいてはなりません。 この場合、 14.18.1 節の規則に従わなければなりません

{1945,2068} If a message is received via direct connection with the user agent (in the case of requests) or the origin server (in the case of responses), then the date can be assumed to be the current date at the receiving end. However, since the date--as it is believed by the origin--is important for evaluating cached responses, origin servers {1945} should always {2068} MUST include a Date header {2068} field in all responses. Clients {1945} should {2068} SHOULD only send a Date header field in messages that include an {1945} entity body {2068} entity-body, as in the case of the {2068} PUT and POST requests {2068}, and even then it is optional. A received message which does not have a Date header field {1945} should {2068} SHOULD be assigned one by the recipient if the message will be cached by that recipient or gatewayed via a protocol which requires a Date.

メッセージが (要求の場合) 利用者エージェント又は起源サーバー (応答の場合) との直接接続により受信したものであれば、日付は受信末端の現在日付と仮定できます。 しかし、日付 —であると起源が信じているもの—はキャッシュ応答の評価に重要ですから、 起源サーバーは全ての応答中に Date 頭を含めるべきですなければなりません。 クライアントは、 PUT 要求及び POST 要求で entity-body を含んでいるメッセージにのみ Date 頭欄を送るべきです。もっとも省略可能ではありますが。 受信したメッセージが Date 頭欄を持たなければ、 メッセージがその受信者にキャッシュされるか又は Date を必須とするプロトコルに関門されるときには、受信者がこれを割当てるべきです

{2616} A received message that does not have a Date header field MUST be assigned one by the recipient if the message will be cached by that recipient or gatewayed via a protocol which requires a Date. An HTTP implementation without a clock MUST NOT cache responses without revalidating them on every use. An HTTP cache, especially a shared cache, SHOULD use a mechanism, such as NTP [28], to synchronize its clock with a reliable external standard.

受信したメッセージが Date 頭欄を持たないとき、 そのメッセージが受信者の一人によりキャッシュされるか又は Date を必須とするプロトコルに関門するなら、 その受信者は日付を割り当てなければなりません。 時計を持たない HTTP 実装は、使用時毎に再検証することなしに応答をキャッシュしてはなりません。 HTTP キャッシュ, 特に共有キャッシュは、 NTP のような時計を信頼できる外部規格により同期する機構を使用するべきです

Clients SHOULD only send a Date header field in messages that include an entity-body, as in the case of the PUT and POST requests, and even then it is optional. A client without a clock MUST NOT send a Date header field in a request.

クライアントは、 PUT 要求や POST 要求の場合で entity-body を含んでいるメッセージにのみ Date 頭欄を送るべきです。もっとも、その場合でも省略可能ではあります。 時計を持たないクライアントは Date 頭欄を要求で送ってはなりません

{2616} The HTTP-date sent in a Date header SHOULD NOT represent a date and time subsequent to the generation of the message. It SHOULD represent the best available approximation of the date and time of message generation, unless the implementation has no means of generating a reasonably accurate date and time. In theory, the date {1945} should {2068} SHOULD {2616} ought to represent the moment just before the entity is generated. In practice, the date can be generated at any time during the message origination without affecting its semantic value.

Date 頭で送信される HTTP-Date はメッセージの生成の後の日時を表現するべきではありませんHTTP-Date は、その実装に適度に正確な日時を生成する手段がない場合を除いて、 メッセージ生成日時の最善の近似を表現するべきです。 理論上は、日付は実体が生成される直前の瞬間を表現するべきです。 実際上は、その意味的値に影響しない範囲でメッセージ生成中の何時でも生成できます。

{1945} Note: An earlier version of this document incorrectly specified that this field should contain the creation date of the enclosed Entity-Body. This has been changed to reflect actual (and proper) usage.

注意 : この文書の初期の版では、この欄は囲まれた実体本体の生成日付を含めるべきであると間違って規定していました。 これは実際の (適切な) 用法を反映するように改めました。

{2068} The format of the Date is an absolute date and time as defined by HTTP-date in section 3.3; it MUST be sent in RFC1123 [8]-date format.

Date の書式は絶対日時です。 RFC 1123 の日付書式で送らなければなりません

14.18.1 Clockless Origin Server Operation 無時計起源サーバー処理

Some origin server implementations might not have a clock available. An origin server without a clock MUST NOT assign Expires or Last-Modified values to a response, unless these values were associated with the resource by a system or user with a reliable clock. It MAY assign an Expires value that is known, at or before server configuration time, to be in the past (this allows "pre-expiration" of responses without storing separate Expires values for each resource).

利用出来る時計を持たない起源サーバー実装もあります。 時計のない起源サーバーは、信頼できる時計のシステム又は利用者によりその資源に関連付けられた値でない限り、 応答に ExpireLast-Modified の値を設定してはなりません。 時計のない起源サーバーは、サーバー設定時またはそれ以前に過去であることが分かっている Expire 値を割り当てても構いません (これによって各資源それぞれの Expire 値を蓄積することなしに 「事前期限切れ」が実現できます)。

関連

[518] Last-Modified: ヘッダーpayload の更新日時を表しています。通常は Date: より前になります。

[17] FIPAの日時形式

[509] HTTP の例 >>505

Date: Tue, 15 Nov 1994 08:12:31 GMT

[9] スパムメールより

Date: 10.7.2014

メモ

[504] Twiggy という PerlWebサーバーDate: を送信しないようです。

[520] RFC 5536 - Netnews Article Format ( ( 版)) http://tools.ietf.org/html/rfc5536#section-3.1.1

[14] Request Authentication and Amazon SES - Amazon Simple Email Service ( 版) http://docs.aws.amazon.com/ses/latest/DeveloperGuide/query-interface-authentication.html

To create the X-Amzn-Authorization header

Create a Date header to be used in the request. For more information, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18.