Internet标准时间RFC3339格式说明

转载地址:点击打开链接

Internet标准时间格式说明

Wednesday, 30. August 2006, 08:35:40

RFC3339, RFC2822, ISO8601

语法定义:


  date-fullyear  = 4DIGIT
  date-month      = 2DIGIT  ; 01-12
  date-mday      = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on
                            ; month/year
  time-hour      = 2DIGIT  ; 00-23
  time-minute    = 2DIGIT  ; 00-59
  time-second    = 2DIGIT  ; 00-58, 00-59, 00-60 based on leap second
                            ; rules
  time-secfrac    = "." 1*DIGIT
  time-numoffset  = ("+" / "-") time-hour ":" time-minute
  time-offset    = "Z" / time-numoffset

  partial-time    = time-hour ":" time-minute ":" time-second
                    [time-secfrac]
  full-date      = date-fullyear "-" date-month "-" date-mday
  full-time      = partial-time time-offset

  date-time      = full-date "T" full-time


限制:


一年中月份的最大天数

Month Number  Month/Year          Maximum value of date-mday
      ------------  ----------          --------------------------
      01            January              31
      02            February, normal    28
      02            February, leap year  29
      03            March                31
      04            April                30
      05            May                  31
      06            June                30
      07            July                31
      08            August              31
      09            September            30
      10            October              31
      11            November            30
      12            December            31


时区:


  三个字符表示美国部分时区.  第一种字符 "E", "C", "M", or "P" 对应 "Eastern",
  "Central","Mountain" 和 "Pacific".  第二种字符如 "S" 对应
  "Standard" 时间, 或者 "D" 对应 "Daylight" (or summer) 时间(夏令时).
  列表如下:

  EDT is 相等于 -0400
  EST is 相等于 -0500
  CDT is 相等于 -0500
  CST is 相等于 -0600
  MDT is 相等于 -0600
  MST is 相等于 -0700
  PDT is 相等于 -0700
  PST is 相等于 -0800

  用一个字符定义时区在RFC822中不大标准,在此定义如下:
 
  RFC2822中定义:
  字母A至I 代表+0100到+0900
  字母k至M 代表+1000到+1200
  字母N至Y 代表-100到-1200
  字母z    代表+0000
 
  在RFC822中定义:
  月份:
  month      =  "Jan"  /  "Feb" /  "Mar"  /  "Apr"
                /  "May"  /  "Jun" /  "Jul"  /  "Aug"
                /  "Sep"  /  "Oct" /  "Nov"  /  "Dec"
  日期:
  day        =  "Mon"  / "Tue" /  "Wed"  / "Thu"
                /  "Fri"  / "Sat" /  "Sun"


Internet标准时间格式例子:


 

      1985-04-12T23:20:50.52Z

  This represents 20 minutes and 50.52 seconds after the 23rd hour of
  April 12th, 1985 in UTC.

      1996-12-19T16:39:57-08:00

  This represents 39 minutes and 57 seconds after the 16th hour of
  December 19th, 1996 with an offset of -08:00 from UTC (Pacific
  Standard Time).  Note that this is equivalent to 1996-12-20T00:39:57Z
  in UTC.

      1990-12-31T23:59:60Z

  This represents the leap second inserted at the end of 1990.

      1990-12-31T15:59:60-08:00

  This represents the same leap second in Pacific Standard Time, 8
  hours behind UTC.

      1937-01-01T12:00:27.87+00:20

  This represents the same instant of time as noon, January 1, 1937,
  Netherlands time.  Standard time in the Netherlands was exactly 19
  minutes and 32.13 seconds ahead of UTC by law from 1909-05-01 through
  1937-06-30.  This time zone cannot be represented exactly using the
  HH:MM format, and this timestamp uses the closest representable UTC
  offset.


RFC 3339标准时间示例:


    2002-10-02T10:00:00-05:00

    2002-10-02T15:00:00Z

    2002-10-02T15:00:00.05Z


RFC-822标准时间示例:


    <pubDate>Wed, 02 Oct 2002 08:00:00 EST </pubDate>

    <pubDate>Wed, 02 Oct 2002 13:00:00 GMT </pubDate>

    <pubDate>Wed, 02 Oct 2002 15:00:00 +0200 </pubDate>
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值