如何将RFC3339的时间格式转化为rfc822的时间格式,很急!

解决方案 »

  1.   

    Internet标准时间格式说明
    Wednesday, 30. August 2006, 08:35:40RFC3339, 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.05ZRFC-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.   

    参考链接
    must be an RFC 3339 date-time
    must be an RFC-822 date-time
    RFC 3339 (RFC3339)
    RFC 2822 (RFC2822)
    RFC 822 (RFC822)