Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
node.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 May 2008 at 04:48 UTC
Updated:
9 Dec 2011 at 10:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
macgirvin commentedsubscribe
Comment #2
pasqualleComment #3
slampy commentedWhy this issue has been moved to the 7.x branch?
This is certainly a bug fix not a new feature request.
It would be great to be committed to the 6.x branch.
Comment #4
pasqualle1. It is marked as feature request, so I automatically moved it to the latest development version..
http://drupal.org/node/73179
2. Every issue should be fixed in the latest development version first and then backported.
Comment #5
j.somers commentedCan someone explain the issue a bit clearer? I cannot find a reference to date() in node_feed() and it should definitely not use the local time when setting the date of a feed item so I don't really see what's wrong with it.
Comment #6
slampy commentedThe source of this issue is that Drupal uses the gmdate() PHP function that returns GMT/UTC time, which won't give a valid RSS feed unless you just use this timezone. The solution is to change this to the date() function and this solves this issue.
This issue appears in Views as well, but they won't change it until it is fixed in Drupal core.
I always manually edited each of my Drupal sites to fix this problem. :-(
To fix this just go to /modules/node/node.module and replace this line:
$extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => gmdate('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid .' at '. $base_url, 'attributes' => array('isPermaLink' => 'false'))));
With:
$extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => date('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid .' at '. $base_url, 'attributes' => array('isPermaLink' => 'false'))));
Comment #7
j.somers commentedAttached is a patch for D7 as suggested in #6.
I see that gmdate() is also used in the following files:
I don't know whether any of these gmdate() usages are subject to the same issue.
Comment #8
damien tournoud commentedWhy do we want to use the local time there? Why does that make an "invalid feed"?
Comment #9
slampy commentedI am not a great technical guy. I have a website and when I wanted my news to appear in an RSS reader they told me, that my RSS feeds are not valid, because of the PubDate timestamp.
What I know for sure that most of the Hungarian websites use this format. For example the biggest news site:
http://index.hu/24ora/rss/
Example:
Tue, 02 Jun 2009 11:53:00 +0200This is done by date() and not gmdate().
Comment #10
mfb@slampy, that seems like a problem with the RSS reader, not Drupal. The RSS reader should not require the dates to use a particular time zone. Any RSS reader I've seen translates all the dates into the local time zone of the person who's using the reader.
Comment #11
neclimdulGMT seems like the desired output actually. GMT is a fairly standard time zone and the output follows the specification.
RFC 822 Data and Time Specification: http://asg.web.cmu.edu/rfc/rfc822.html#sec-5
Just to make sure I did some more research and it seems that wordpress, and joomla both use this pubDate as GMT functionality however zend changed it to the suggested local time rather recently. Curiosity peeked, I found that there is actually a replacement RFC for 822(2822) that changes the wording to specify local time.
Even so RFC 822 dates as GMT seem to be the overwhelming standard. Furthermore, RFC 2822 was published before the RSS 2.0 specification but the wording specifically references the earlier RFC 822. So seems to me Drupal is doing the right thing here unless we can get specific reasons this is incorrect.
Comment #12
johnmunro commentedPrevious comment was incorrect. Local settings had been changed! Sorry.
Comment #13
rudiedirkx commentedMy problem isn't the timezone, but the date format.
D, d M Y H:i:s Tis correct, but it's rendered as Dutch (in this case), soDwill be "wo" instead of "Wed".Readers don't get that.
The date should be English, always, whatever the current locale. I couldn't care less about a few hours offset. Dutch people read Dutch feeds, Americans American feeds and Chinese Chinese feeds etc.
Comment #14
damien tournoud commented@rudiedirkx: Drupal feeds are going to output the proper date format, regardless of the locale of the site. Do you have an example of a case in which it fails?
Comment #15
damien tournoud commented@rudiedirkx: Also, if you are using Drupal 6, you might be bumping into #614124: Bootstrap should reset locale settings. Help review the patch there.