SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    uk
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RFC-822 date-time

    ive created an RSS output with PHP but the RSS wont validate. the validator error says -

    Invalid date-time. The value specified must meet the Date and Time specifications as defined by RFC822, with the exception that the year should be expressed as four digits.
    Solution

    Change the date-time format to comply with RFC822. Here are examples of valid RFC822 date-times:

    <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>

    however my date is in this format...

    This feed does not validate.
    *
    line 8, column 58: pubDate must be an RFC-822 date-time: Thu, 19 Jul 2007 21:51:27 BST [help]

    <pubDate>Thu, 19 Jul 2007 21:51:27 BST</pubDate>

    this is identical to the 2 top examples listed so has anyone a clue what this validator is objecting to?

    its driving me nuts trying to spot it...

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I *think* RFC822 only allows the 8 North American time zones to be named (4 standard time, 4 daylight savings time); for all others, you have to either convert to GMT or specify the hour offset. Worth a try at least.

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    uk
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks

    changing T to O was all it needed.

    i just could not find that info on what parameters were allowed...

  4. #4
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Checking the referenced RFC turned up your answer very quickly:
    Quote Originally Posted by RFC822
    5. DATE AND TIME SPECIFICATION
    5.1. SYNTAX
    date-time = [ day "," ] date time ; dd mm yy
    ; hh:mm:ss zzz
    day = "Mon" / "Tue" / "Wed" / "Thu"
    / "Fri" / "Sat" / "Sun"
    date = 1*2DIGIT month 2DIGIT ; day month year
    ; e.g. 20 Jun 82
    month = "Jan" / "Feb" / "Mar" / "Apr"
    / "May" / "Jun" / "Jul" / "Aug"
    / "Sep" / "Oct" / "Nov" / "Dec"
    time = hour zone ; ANSI and Military
    hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT]
    ; 00:00:00 - 23:59:59
    zone = "UT" / "GMT" ; Universal Time
    ; North American : UT
    / "EST" / "EDT" ; Eastern: - 5/ - 4
    / "CST" / "CDT" ; Central: - 6/ - 5
    / "MST" / "MDT" ; Mountain: - 7/ - 6
    / "PST" / "PDT" ; Pacific: - 8/ - 7
    / 1ALPHA ; Military: Z = UT;
    ; A:-1; (J not used)
    ; M:-12; N:+1; Y:+12
    / ( ("+" / "-") 4DIGIT ) ; Local differential
    ; hours+min. (HHMM)
    Thus the allowed named timezones are only 4 of the 6 US time zones; other than that you either need the military single-letter designation or the 4-digit timezone offset.
    PHP questions? RTFM
    MySQL questions? RTFM


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •