Ignore:
Timestamp:
04/01/13 10:29:06 (8 years ago)
Author:
fielding@…
Message:

Yet another attempt to explain HTTP-date, remove redundant requirements in sections that use HTTP-date, and correct some inconsistent requirements regarding time zones; related to #375 and [2077]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p2-semantics.xml

    r2080 r2082  
    35163516  <x:anchor-alias value="HTTP-date"/>
    35173517<t>
    3518    HTTP has historically allowed three different formats
    3519    for date/time stamps. However, the preferred format is a fixed-length subset
    3520    of that defined by <xref target="RFC1123"/>:
    3521 </t>
    3522 <figure><artwork type="example" x:indent-with="  ">
    3523 Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 1123
     3518   Prior to 1995, there were three different formats commonly used by servers
     3519   to communicate timestamps.  For compatibility with old implementations, all
     3520   three are defined here. The preferred format is a fixed-length and
     3521   single-zone subset of the date and time specification used by the
     3522   Internet Message Format <xref target="RFC5322"/>.
     3523</t>
     3524<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-date"/>
     3525  <x:ref>HTTP-date</x:ref>    = <x:ref>IMF-fixdate</x:ref> / <x:ref>obs-date</x:ref>
    35243526</artwork></figure>
    3525 <t>
    3526    The other formats are described here only for compatibility with obsolete
    3527    implementations.
    3528 </t>
    3529 <figure><artwork type="example" x:indent-with="  ">
    3530 Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format
    3531 Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
     3527<figure><preamble>An example of the preferred format is</preamble><artwork type="example" x:indent-with="  ">
     3528Sun, 06 Nov 1994 08:49:37 GMT    ; IMF-fixdate
    35323529</artwork></figure>
    3533 <t>
    3534    HTTP always represents dates as an instance of Coordinated Universal Time
    3535    (UTC), without exception; the first two formats indicate UTC as "GMT" in
    3536    the three-letter abbreviation for time zone. Recipients &MAY; assume UTC
    3537    even if the time zone abbreviation is missing, invalid, or might indicate
    3538    some other time zone.
    3539 </t>
    3540 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-date"/>
    3541   <x:ref>HTTP-date</x:ref>    = <x:ref>rfc1123-date</x:ref> / <x:ref>obs-date</x:ref>
     3530<figure><preamble>Examples of the two obsolete formats are</preamble><artwork type="example" x:indent-with="  ">
     3531Sunday, 06-Nov-94 08:49:37 GMT   ; obsolete RFC 850 format
     3532Sun Nov  6 08:49:37 1994         ; ANSI C's asctime() format
    35423533</artwork></figure>
     3534<t>
     3535   A recipient that parses a timestamp value in an HTTP header field &MUST;
     3536   accept all three formats. A sender &MUST; generate the IMF-fixdate
     3537   format when sending an HTTP-date value in a header field.
     3538</t>
     3539<t>
     3540   An HTTP-date value represents time as an instance of Coordinated Universal
     3541   Time (UTC). The first two formats indicate UTC by the three-letter
     3542   abbreviation for Greenwich Mean Time, "GMT", a predecessor of the UTC name;
     3543   values in the asctime format are assumed to be in UTC.
     3544   A sender that generates HTTP-date values from a local clock ought to use
     3545   NTP (<xref target="RFC1305"/>) or some similar protocol to synchronize its
     3546   clock to UTC.
     3547</t>
    35433548<t anchor="preferred.date.format">
    3544   <x:anchor-alias value="rfc1123-date"/>
     3549  <x:anchor-alias value="IMF-fixdate"/>
    35453550  <x:anchor-alias value="time-of-day"/>
    35463551  <x:anchor-alias value="hour"/>
     
    35543559  Preferred format:
    35553560</t>
    3556 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="rfc1123-date"/><iref primary="true" item="Grammar" subitem="date1"/><iref primary="true" item="Grammar" subitem="time-of-day"/><iref primary="true" item="Grammar" subitem="hour"/><iref primary="true" item="Grammar" subitem="minute"/><iref primary="true" item="Grammar" subitem="second"/><iref primary="true" item="Grammar" subitem="day-name"/><iref primary="true" item="Grammar" subitem="day-name-l"/><iref primary="true" item="Grammar" subitem="day"/><iref primary="true" item="Grammar" subitem="month"/><iref primary="true" item="Grammar" subitem="year"/><iref primary="true" item="Grammar" subitem="GMT"/>
    3557   <x:ref>rfc1123-date</x:ref> = <x:ref>day-name</x:ref> "," <x:ref>SP</x:ref> date1 <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>GMT</x:ref>
    3558   ; fixed length subset of the format defined in
    3559   ; <xref target="RFC1123" x:fmt="of" x:sec="5.2.14"/>
     3561<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="IMF-fixdate"/><iref primary="true" item="Grammar" subitem="date1"/><iref primary="true" item="Grammar" subitem="time-of-day"/><iref primary="true" item="Grammar" subitem="hour"/><iref primary="true" item="Grammar" subitem="minute"/><iref primary="true" item="Grammar" subitem="second"/><iref primary="true" item="Grammar" subitem="day-name"/><iref primary="true" item="Grammar" subitem="day-name-l"/><iref primary="true" item="Grammar" subitem="day"/><iref primary="true" item="Grammar" subitem="month"/><iref primary="true" item="Grammar" subitem="year"/><iref primary="true" item="Grammar" subitem="GMT"/>
     3562  <x:ref>IMF-fixdate</x:ref> = <x:ref>day-name</x:ref> "," <x:ref>SP</x:ref> date1 <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>GMT</x:ref>
     3563  ; fixed length/zone subset of the format defined in
     3564  ; <xref target="RFC5322" x:fmt="of" x:sec="3.3"/>
    35603565 
    35613566  <x:ref>day-name</x:ref>     = <x:abnf-char-sequence>"Mon"</x:abnf-char-sequence> ; "Mon", case-sensitive
     
    35853590  <x:ref>year</x:ref>         = 4<x:ref>DIGIT</x:ref>
    35863591
    3587   <x:ref>GMT</x:ref>   = <x:abnf-char-sequence>"GMT"</x:abnf-char-sequence> ; "GMT", case-sensitive
     3592  <x:ref>GMT</x:ref>          = <x:abnf-char-sequence>"GMT"</x:abnf-char-sequence> ; "GMT", case-sensitive
    35883593
    35893594  <x:ref>time-of-day</x:ref>  = <x:ref>hour</x:ref> ":" <x:ref>minute</x:ref> ":" <x:ref>second</x:ref>
    3590                  ; 00:00:00 - 23:59:59
     3595               ; 00:00:00 - 23:59:60 (leap second)
    35913596                 
    35923597  <x:ref>hour</x:ref>         = 2<x:ref>DIGIT</x:ref>               
     
    35943599  <x:ref>second</x:ref>       = 2<x:ref>DIGIT</x:ref>               
    35953600</artwork></figure>
    3596 <t>
    3597   The semantics of <x:ref>day-name</x:ref>, <x:ref>day</x:ref>,
    3598   <x:ref>month</x:ref>, <x:ref>year</x:ref>, and <x:ref>time-of-day</x:ref> are the
    3599   same as those defined for the RFC 5322 constructs
    3600   with the corresponding name (<xref target="RFC5322" x:fmt="," x:sec="3.3"/>).
    3601 </t>
    36023601<t anchor="obsolete.date.formats">
    36033602  <x:anchor-alias value="obs-date"/>
     
    36163615  <x:ref>rfc850-date</x:ref>  = <x:ref>day-name-l</x:ref> "," <x:ref>SP</x:ref> <x:ref>date2</x:ref> <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>GMT</x:ref>
    36173616  <x:ref>date2</x:ref>        = <x:ref>day</x:ref> "-" <x:ref>month</x:ref> "-" 2<x:ref>DIGIT</x:ref>
    3618                  ; day-month-year (e.g., 02-Jun-82)
    3619 
    3620   <x:ref>day-name-l</x:ref>   = <x:abnf-char-sequence>"Monday"</x:abnf-char-sequence> ; "Monday", case-sensitive
    3621          / <x:abnf-char-sequence>"Tuesday"</x:abnf-char-sequence> ; "Tuesday", case-sensitive
     3617               ; e.g., 02-Jun-82
     3618
     3619  <x:ref>day-name-l</x:ref>   = <x:abnf-char-sequence>"Monday"</x:abnf-char-sequence>    ; "Monday", case-sensitive
     3620         / <x:abnf-char-sequence>"Tuesday"</x:abnf-char-sequence>       ; "Tuesday", case-sensitive
    36223621         / <x:abnf-char-sequence>"Wednesday"</x:abnf-char-sequence> ; "Wednesday", case-sensitive
    3623          / <x:abnf-char-sequence>"Thursday"</x:abnf-char-sequence> ; "Thursday", case-sensitive
    3624          / <x:abnf-char-sequence>"Friday"</x:abnf-char-sequence> ; "Friday", case-sensitive
    3625          / <x:abnf-char-sequence>"Saturday"</x:abnf-char-sequence> ; "Saturday", case-sensitive
    3626          / <x:abnf-char-sequence>"Sunday"</x:abnf-char-sequence> ; "Sunday", case-sensitive
     3622         / <x:abnf-char-sequence>"Thursday"</x:abnf-char-sequence>    ; "Thursday", case-sensitive
     3623         / <x:abnf-char-sequence>"Friday"</x:abnf-char-sequence>          ; "Friday", case-sensitive
     3624         / <x:abnf-char-sequence>"Saturday"</x:abnf-char-sequence>    ; "Saturday", case-sensitive
     3625         / <x:abnf-char-sequence>"Sunday"</x:abnf-char-sequence>          ; "Sunday", case-sensitive
    36273626</artwork></figure>
    36283627<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="asctime-date"/>
    36293628  <x:ref>asctime-date</x:ref> = <x:ref>day-name</x:ref> <x:ref>SP</x:ref> <x:ref>date3</x:ref> <x:ref>SP</x:ref> <x:ref>time-of-day</x:ref> <x:ref>SP</x:ref> <x:ref>year</x:ref>
    36303629  <x:ref>date3</x:ref>        = <x:ref>month</x:ref> <x:ref>SP</x:ref> ( 2<x:ref>DIGIT</x:ref> / ( <x:ref>SP</x:ref> 1<x:ref>DIGIT</x:ref> ))
    3631                  ; month day (e.g., Jun  2)
     3630               ; e.g., Jun  2
    36323631</artwork></figure>
    36333632<t>
     
    36353634   A sender &MUST-NOT; generate additional whitespace in an HTTP-date beyond
    36363635   that specifically included as SP in the grammar.
    3637 </t>
    3638 <t>
    3639    Recipients that parse a date value &MUST; accept all three formats (for
    3640    compatibility with HTTP/1.0). A sender &MUST; only generate the RFC 1123
    3641    format when sending HTTP-date values in header fields.
    3642 </t>
    3643 <x:note>
    3644   <t>
    3645     &Note; Recipients of date values are encouraged to be robust in
    3646     accepting date values that might have been sent by non-HTTP
    3647     applications, as is sometimes the case when retrieving or posting
    3648     messages via proxies/gateways to SMTP or NNTP.
    3649   </t>
    3650 </x:note>
     3636   The semantics of <x:ref>day-name</x:ref>, <x:ref>day</x:ref>,
     3637   <x:ref>month</x:ref>, <x:ref>year</x:ref>, and <x:ref>time-of-day</x:ref>
     3638   are the same as those defined for the Internet Message Format constructs
     3639   with the corresponding name (<xref target="RFC5322" x:fmt="," x:sec="3.3"/>).
     3640</t>
     3641<t>
     3642   Recipients of a timestamp value in rfc850-date format, which uses a
     3643   two-digit year, &SHOULD; interpret a timestamp that appears to be more
     3644   than 50 years in the future as representing the most recent year in the
     3645   past that had the same last two digits.
     3646</t>
     3647<t>
     3648   Recipients of timestamp values are encouraged to be robust in parsing
     3649   timestamps unless otherwise restricted by the field definition.
     3650   For example, messages are occasionally forwarded over HTTP from a non-HTTP
     3651   source that might generate any of the date and time specifications defined
     3652   by the Internet Message Format.
     3653</t>
    36513654<x:note>
    36523655  <t>
    36533656    &Note; HTTP requirements for the date/time stamp format apply only
    3654     to their usage within the protocol stream. Clients and servers are
     3657    to their usage within the protocol stream. Implementations are
    36553658    not required to use these formats for user presentation, request
    36563659    logging, etc.
     
    36663669   the message was originated, having the same semantics as the Origination
    36673670   Date Field (orig-date) defined in <xref target="RFC5322" x:fmt="of" x:sec="3.6.1"/>.
    3668    The field value is an HTTP-date, as defined in <xref target="http.date"/>,
    3669    though a sender &MUST; generate a Date value in the rfc1123-date format.
     3671   The field value is an HTTP-date, as defined in <xref target="http.date"/>.
    36703672</t>
    36713673<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Date"/>
     
    36873689<t>
    36883690   An origin server &MUST-NOT; send a Date header field if it does not have a
    3689    clock capable of providing a reasonable approximation of the current time.
     3691   clock capable of providing a reasonable approximation of the current
     3692   instance in Coordinated Universal Time.
    36903693   An origin server &MAY; send a Date header field if the response is in the
    36913694   <x:ref>1xx (Informational)</x:ref> or <x:ref>5xx (Server Error)</x:ref>
     
    51985201</reference>
    51995202
    5200 <reference anchor="RFC1123">
    5201   <front>
    5202     <title>Requirements for Internet Hosts - Application and Support</title>
    5203     <author initials="R." surname="Braden" fullname="Robert Braden">
    5204       <organization>University of Southern California (USC), Information Sciences Institute</organization>
    5205       <address><email>Braden@ISI.EDU</email></address>
    5206     </author>
    5207     <date month="October" year="1989"/>
    5208   </front>
    5209   <seriesInfo name="STD" value="3"/>
    5210   <seriesInfo name="RFC" value="1123"/>
     5203<reference anchor="RFC1305">
     5204 <front>
     5205   <title>Network Time Protocol (Version 3) Specification, Implementation</title>
     5206   <author fullname="David L. Mills" initials="D." surname="Mills">
     5207     <organization>University of Delaware, Electrical Engineering Department</organization>
     5208     <address><email>mills@udel.edu</email></address>
     5209   </author>
     5210   <date month="March" year="1992" />
     5211 </front>
     5212 <seriesInfo name="RFC" value="1305" />
    52115213</reference>
    52125214
     
    59935995<x:ref>GMT</x:ref> = %x47.4D.54 ; GMT
    59945996
    5995 <x:ref>HTTP-date</x:ref> = rfc1123-date / obs-date
     5997<x:ref>HTTP-date</x:ref> = IMF-fixdate / obs-date
     5998
     5999<x:ref>IMF-fixdate</x:ref> = day-name "," SP date1 SP time-of-day SP GMT
    59966000
    59976001<x:ref>Location</x:ref> = URI-reference
     
    60876091<x:ref>qvalue</x:ref> = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
    60886092
    6089 <x:ref>rfc1123-date</x:ref> = day-name "," SP date1 SP time-of-day SP GMT
    60906093<x:ref>rfc850-date</x:ref> = day-name-l "," SP date2 SP time-of-day SP GMT
    60916094
Note: See TracChangeset for help on using the changeset viewer.