Question

i´m having troubles generating a valid tag in a rss2.0 xml document

I´m using this code

 pubDate(review.dtCreated.format('EEE, d MMM yyyy HH:mm:ss Z'))

it results in

<pubDate>Di, 21 Mai 2013 16:48:28 +0200</pubDate>

that looks correct for me but w3c-feed validator says

 pubDate must be an RFC-822 date-time: Di, 21 Mai 2013 16:48:28 +0200

on the help page they have an example :

<pubDate>Wed, 02 Oct 2002 15:00:00 +0200</pubDate>

did i look too long on the screen or is there really a diferrence between my formatted date and the feed-validator´s example ?=

how to get this correct ?

for any hint thanks in advance

Was it helpful?

Solution

Try it in an English Locale:

pubDate( new java.text.SimpleDateFormat( 'EEE, d MMM yyyy HH:mm:ss Z', Locale.US ).format( review.dtCreated ) )

According to the RFC, Di is not allowed as a day name:

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top