HTTP protocol applications for date and time

Source: Internet
Author: User
Tags date1

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:

 
 
  1. Sun, 06 Nov 1994 08:49:37 GMT; RFC 822, updated by RFC 1123  
  2. Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036  
  3. 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.

 
 
  1. HTTP-date= rfc1123-date | rfc850-date | asctime-date  
  2. rfc1123-date = wkday "," SP date1 SP time SP "GMT"  
  3. rfc850-date= weekday "," SP date2 SP time SP "GMT"  
  4. asctime-date = wkday SP date3 SP time SP 4DIGIT  
  5. date1 = 2DIGIT SP month SP 4DIGIT  
  6.  ; day month year (e.g., 02 Jun 1982)  
  7. date2 = 2DIGIT "-" month "-" 2DIGIT  
  8.  ; day-month-year (e.g., 02-Jun-82)  
  9. date3 = month SP ( 2DIGIT | ( SP 1DIGIT ))  
  10.  ; month day (e.g., Jun2)  
  11. time= 2DIGIT ":" 2DIGIT ":" 2DIGIT  
  12.  ; 00:00:00 - 23:59:59  
  13. wkday = "Mon" | "Tue" | "Wed"  
  14. | "Thu" | "Fri" | "Sat" | "Sun"  
  15. weekday= "Monday" | "Tuesday" | "Wednesday"  
  16. | "Thursday" | "Friday" | "Saturday" | "Sunday"  
  17. month = "Jan" | "Feb" | "Mar" | "Apr"  
  18. | "May" | "Jun" | "Jul" | "Aug"  
  19. | "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.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.