Pregunta

I have an XML file for event information. There is an entry for Abuja, Nigeria. Everything that I've seen says that the time zone abbreviation is WAT. But, the w3 feed validator says that it's invalid. If I replace WAT with CST, it validates. It seems like the problem is strictly with that time zone.

W3 Feed Validator Results:

Sorry
This feed does not validate.
line 106, column 41: pubDate must be an RFC-822 date-time: Fri, 01 Nov 2013 16:00:00 WAT [help]
<pubDate>Fri, 01 Nov 2013 16:00:00 WAT</pubDate>

XML Code:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:xxx="http://www.xxx.org/">
    <channel>
        <title>Upcoming Events</title>
        <link>http://www.xxx.org</link>
        <description></description>
        <atom:link href="http://www.xxx.org/rss/Events.xml" rel="self" type="application/rss+xml" />
        <item>
            <title>xxx</title>
            <xxx:host>Hosted by xxx</xxx:host>
            <xxx:speaker>Speaking: xxx</xxx:speaker>
            <dc:creator>xxx</dc:creator>
            <pubDate>Fri, 01 Nov 2013 16:00:00 WAT</pubDate>
            <xxx:extraDate1>Sat, 02 Nov 2013 16:00:00 WAT</xxx:extraDate1>
            <xxx:extraDate2>Sun, 03 Nov 2013 07:00:00 WAT</xxx:extraDate2>
            <xxx:endDate>Sun, 03 Nov 2013 15:00:00 WAT</xxx:endDate>
            <link>http://www.xxx.org</link>
            <xxx:venue>xxx</xxx:venue>
            <xxx:address>xxx</xxx:address>
            <xxx:location>xxx</xxx:location>
            <xxx:zip></xxx:zip>
            <xxx:phone>xxx</xxx:phone>
            <xxx:notes></xxx:notes>
        </item>
    </channel>
</rss>

That XML is edited down, for brevity. I've had multiple American time zones, but this is the first foreign time zone.

The file works with RSS readers and I have a PHP page that works with it. The problem is that I'm working with some JavaScript and it's throwing up an invalid XML error.

Is there actually something wrong with <pubDate>? I don't see it, if there is.

¿Fue útil?

Solución

The spec is pretty clear:

http://asg.web.cmu.edu/rfc/rfc822.html#sec-5.1

 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)

You need to use the local differential (in this case +0100)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top