`
wuhua
  • 浏览: 2111984 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Date/Time Formats

    博客分类:
  • HTTP
SUN 
阅读更多

3.3 Date/Time Formats
3.3.1 Full Date

HTTP applications have historically allowed three different formats for the representation of 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 Nov  6 08:49:37 1994       ; ANSI C's asctime() format

The first format is preferred as an Internet standard and represents a fixed-length subset of that defined by RFC 1123 [8] (an update to RFC 822 [9]). The second format is in common use, but is based on the obsolete RFC 850 [12] date format and lacks a four-digit year. HTTP/1.1 clients and servers that parse the date value MUST accept all three formats (for compatibility with HTTP/1.0), though they MUST only generate the RFC 1123 format for representing HTTP-date values in header fields. See section 19.3 for further information.
      Note: Recipients of date values are encouraged to be robust in
      accepting date values that may have been sent by non-HTTP
      applications, as is sometimes the case when retrieving or posting
      messages via proxies/gateways to SMTP or NNTP.

All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal Time). This is indicated in the first two formats by the inclusion of "GMT" as the three-letter abbreviation for time zone, and MUST be assumed when reading the asctime format. HTTP-date is case sensitive and MUST NOT include additional LWS beyond that specifically included as SP in the grammar.
       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., Jun  2)
       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 requirements for the date/time stamp format apply only
      to their usage within the protocol stream. Clients and servers are
      not required to use these formats for user presentation, request
      logging, etc.

分享到:
评论

相关推荐

    ACCESS日期时间函数[文].pdf

    8. **Custom Date/Time Formats (Format Function)**: Access提供了多种预定义的日期和时间格式,比如: - **ddddd** 和 **dddddd** 分别显示短日期和长日期。 - **D** 和 **Dd** 用于显示不带和带零填充的日。 -...

    http RFC文件

    3.3 Date/Time Formats ...........................................20 3.3.1 Full Date ................................................20 3.3.2 Delta Seconds .............................................

    NaturalDateFormat,.zip

    按照材料设计指南(https://www.google.com/design/spec/patterns/data formats.html data formats date time)中的说明格式化日期的库。

    daily-change:减少碳足迹计算器-Rails CRUD早期项目

    试试这个时间戳(推荐用于Rails(在application.html.erb中):config / initializers / time_formats.rb Date :: DATE_FORMATS [:stamp] =“%Y%m%d”#YYYYMMDD Time :: DATE_FORMATS [:stamp] ] =“%Y%m%...

    Mysql 日期时间 DATE_FORMAT(date,format)

    Formats the date value according to the format string. The following specifiers may be used in the format string. As of MySQL 3.23, the “%” character is required before format spe

    SPSS statistic command syntax

    SPSS的命令语法还涉及到变量类型和格式(Variable Types and Formats)、输入和输出格式(Input and Output Formats)、字符串变量格式(String ...格式(Date and Time Formats)、FORTRAN风格的输入格式规范(FORTRAN...

    EMS.Advanced.Data.Export.VCL.v4.9.0.1.Full.Source

    Added the possibility to append date/time to the exported file name. The AppendDateTimeToFileName and AppendDateTimeToDatabaseName (TADO_QExport4Access) properties. Use the ExportedFileName and ...

    Laravel开发-timezones .zip.zip

    <p>{{ __('date.formats.long') }}</p> ``` 综上所述,这个“Laravel开发-timezones .zip.zip”压缩包的内容可能涉及Laravel中时间区域的配置、日期时间对象的创建与操作、数据库中的时间戳处理、以及多语言支持等...

    php使用strtotime和date函数判断日期是否有效代码分享

    if (date($format, $unixTime) == $date) { return true; // 找到匹配的格式,日期有效 } } return false; // 没有找到匹配的格式,日期无效 } var_dump(checkDateIsValid("2013-09-10")); // 输出:true var_...

    DateTime-Format-ISO8601:解析ISO8601格式

    # This format is ambiguous and could be either a date or time, so use the# parse_time method.my $time_str = '113231';$dt = DateTime::Format::ISO8601->parse_time($time_str);say $dt;# ormy

    SAS学习系列08.日期时间数据及数据格式.pdf

    title 'SAS Dates without and with Formats'; run; ``` 这个程序将读取借书卡数据,计算剩余期限和持卡人年龄,并判断一个卡是否为新卡。输出结果将显示借书卡的详细信息,包括姓名、出生日期、卡办理日期、到期日...

    Python-python解析器对人类可读的日期

    dateparser.set_default_date_formats(['%d %B %Y', '%m/%d/%y']) ``` 8. **性能与限制** 虽然dateparser强大且灵活,但解析复杂日期字符串可能会消耗较多资源。在处理大量数据时,可能需要考虑性能优化。 9. *...

    Java Web整合开发王者归来

    for (DateFormat format : dateFormats) { // 使用3种格式化器尝试转换日期 try { return new java.sql.Date(format.parse(parameterValues[0]).getTime()); } catch (ParseException e) { // 如果解析失败则...

    SAS_online_tutorial_for_base_exam

    Reading Date and Time Values Creating a Single Observation from Multiple Records Creating Multiple Observations from a Single Record Reading Hierarchical Files Reading Variable-Length Records

    sas9.2 sid破解

    *PRODNUM208 = PCFILE SAS/ACCESS PC File Formats; *PRODNUM209 = ODBC SAS/ACCESS ODBC; *PRODNUM215 = OLEDB SAS/ACCESS TO OLE DB; *PRODNUM535 = STATSTUDIO SAS/IML Studio; *PRODNUM538 = WKSPSRVLOCAL ...

    HTTP1.1协议规范(中文归纳版)

    - **Date and Time Formats (日期和时间格式)**:HTTP支持多种日期和时间格式。 - **Host (主机)**:请求的目标主机。 - **Port (端口)**:服务监听的端口号。 - **Charset (字符集)**:指定文本的编码方式。 -...

    C_获取当前时间的各种格式

    TimeSpan timeOfDay = DateTime.Now.TimeOfDay; // 输出类似于 "13:30:28.4412864" ``` #### 7. 时间操作 - **`dt.AddYears(int years)`**:向当前时间添加或减去年份。 示例: ```csharp DateTime newDate...

Global site tag (gtag.js) - Google Analytics