When learning HTTP, we have to focus on HTTP application. We should be clear about the time/Date Format of the HTTP application. Now we want to focus on the complete date. Other parts will be added later. I hope you will continue to pay attention to it.
Complete date
In history, HTTP protocol applications have allowed three different formats to represent date/time stamps:
- Sun, 06 Nov 1994 08:49:37 GMT; RFC 822, updated by RFC 1123
- Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
- Sun Nov6 08:49:37 1994; ANSI C's asctime() format
The first format is proposed as an Internet standard, which represents a fixed-length subset defined by RFC 1123 [8] (an upgraded version of RFC 822 [9. the second format is widely used, but based on the obsolete RFC 850 [12], the year needs to be expressed in four digits. the HTTP/1.1 client and server that perform syntax analysis on the date value must accept all three formats (to be compatible with HTTP/1.0 ), although they must only generate the RFC 1123 format to indicate the HTTP date value in the header field.
Note: We encourage the recipient of the date value to be firm in accepting the date value that may be sent by a non-HTTP application, such non-HTTP applications sometimes retrieve or post messages through the proxy/gateway to SMTP or NNTP.
All HTTP date/time stamps must be expressed in Greenwich Mean Time (GMT) without exception. for HTTP, GMT is equivalent to UTC (coordinated world time ). in the first two forms, the time zone abbreviation-GMT is used for representation, and it must be assumed before reading the ASC time format. HTTP date is case-sensitive. Apart from being an LWS special to SP in syntax, it must not include additional LWS.
- HTTP-date= rfc1123-date | rfc850-date | asctime-date
- rfc1123-date = wkday "," SP date1 SP time SP "GMT"
- rfc850-date= weekday "," SP date2 SP time SP "GMT"
- asctime-date = wkday SP date3 SP time SP 4DIGIT
- date1 = 2DIGIT SP month SP 4DIGIT
- ; day month year (e.g., 02 Jun 1982)
- date2 = 2DIGIT "-" month "-" 2DIGIT
- ; day-month-year (e.g., 02-Jun-82)
- date3 = month SP ( 2DIGIT | ( SP 1DIGIT ))
- ; month day (e.g., Jun2)
- time= 2DIGIT ":" 2DIGIT ":" 2DIGIT
- ; 00:00:00 - 23:59:59
- wkday = "Mon" | "Tue" | "Wed"
- | "Thu" | "Fri" | "Sat" | "Sun"
- weekday= "Monday" | "Tuesday" | "Wednesday"
- | "Thursday" | "Friday" | "Saturday" | "Sunday"
- month = "Jan" | "Feb" | "Mar" | "Apr"
- | "May" | "Jun" | "Jul" | "Aug"
- | "Sep" | "Oct" | "Nov" | "Dec"
Note: HTTP requests in the date/time stamp format are only applied in the Protocol stream. Customers and servers do not have to use these formats for user briefing, request records, and others.