In order to conform to the standard date for RSS, it's necessary the date format of: D, d M Y H:i:s T
When Drupal is not configured for English, the above date format produces a non-conforming date for RSS feeds as "Mon" for Monday in English then becomes "Lun" in Italian for example. Ideally, the Date module would provide a number formatted for DATE_RSS, but as there are 500+ issues in the queue, I don't think it's going to be done anytime soon.
Can we look at a way of implementing this feature into Views RSS, allowing for international sites to also use this excellent module?
Here is a quick hack I implimented recently: (the format for the date I am using does not have the time, just the date so I filled in the time with 17:00:00
// Expects a date begining with the formatting: YYYY-MM-DD (2010-10-28)
$timestamp = mktime(17, 0, 0, substr($item['pubDate'], 5, 2), substr($item['pubDate'], 8, 2), substr($item['pubDate'], 0, 4));
$item['pubDate'] = date(DATE_RSS, $timestamp);
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screen Shot 2012-12-19 at 15.57.17.png | 62.88 KB | scuba_fly |
Comments
Comment #1
andrewsuth commentedSorry, mine issue is a duplicate of http://drupal.org/node/703980
Comment #2
eiland commentedi feel a bit not too smart, but where did you apply your hack? in the views_rss module?
I tried everything and my view keeps on returning
<pubDate>Tue, 2011-07-19</pubDate>which doesnt validate for the feed, no idea where to change it.
Comment #3
gagarine commentedI don't think it's a duplicate and it's still present in D7.
Comment #4
MauMauHere's a quickfix:
Make a template. Mine is
and make it say
This will probably give you a valid, english RFC 822 compliant date.
If not
might help.
Testing: paste the preview from views into
http://validator.w3.org/feed/#validate_by_input
to check if you're getting RFC 822 right
Further reading:
http://php.net/manual/en/function.date.php
http://php.net/manual/en/function.setlocale.php
Comment #5
juc1 commented@ MauMau or anyone - will the template suggestion in #4 work for 6.x-2.0-rc3?
Thanks
Comment #6
plazik commented#4 works for me in 7.x.
Comment #7
juc1 commented@ Plazik or anyone - sorry for being thick but does #4 give the entire tpl.php file or just a part of it?
Thanks
Comment #8
plazik commentedJuc1, it's full tpl.php file.
Comment #9
juc1 commented@ Plazik, sorry is this the entire file??
Thanks
Comment #10
plazik commentedYeah.
Comment #11
juc1 commentedOK thanks - but last thing can you please tell me how I work out the name of the template instead of
views-view-field--nodequeue-2--feed-2--created.tpl.php ?
Thank you
Comment #12
plazik commentedWhy instead of?
Use the name what Views tell you. My name like this views-view-field--nodequeue-2--feed-2--created.tpl.php
Comment #13
scuba_flyI got stuck with this issue as well but after setting the field to 'Custom date format' and placing
rin the field it now shows up as the RFC822 date-time format and my feeds validates in the w3c feed validator.So I think you can call this fixed although it would be nice to set it to the english version by default.
For reference I've included a screenshot:

As a site note I'm using Views 7.x-3.5 but I think that it is fixed or can be fixed by using the described method. If not reopen the issue.
Comment #15
killes@www.drop.org commentedI can not confirm that this is fixed.
It seems to work for the build date of the feed, but not for the pubDate of the feed items.
It may seem to work, if the translated date happens to be the same as the one in English (ie it worked in April for German sites, but stopped in May).
Comment #16
killes@www.drop.org commentedI am not sure why, but it's fixed for me now...
Comment #18
zarudnyi commentedSolution from # 13 works for me.
I think we have to have it in the module for all non-english feeds by default.
Thanks.
Comment #19
whatdoesitwant commentedSolution #13 only applies to entity metadata (dateinformation on the node (created date, edited date). It does not work on date-fields.
Comment #20
finex commentedUsing 'r' instead of 'D, d M Y H:i:s O' works fine. Thanks.
Comment #21
ciss commentedNothing to review. Setting to support request and closing, as this seems to match the conversation and solution.
Comment #23
aiphes#20 help me to fix the issue with the D8 version. Thanks