• I live in a GMT+1 zone (Denmark) and would like to have the UTC adjusted to relect this so that postings are shown correctly in RSS feeds to my subscribers.
    Also, my webhost resides in the US – but as far as I can tell, this should not affect WP in any way since it relies on UTC?

    At any rate, I have in the WP admin page adjusted the time of the blog to be UTC +2 hours (this is the defacto time difference between the WP UTC time and my actual time), and the correct time is displayed in WP admin area AND also the timestamp on posts are correct.

    However, when I access my RSS feed, the date is shown as (for instance):

    <pubDate>Wed, 13 Jun 2007 11:10:04 +0000</pubDate>

    When in fact it should be:

    <pubDate>Wed, 13 Jun 2007 11:10:04 +0200</pubDate>

    since I have made the changes to WP to adjust for the time difference – apparently this is ignored for the RSS feeds.

    I am no PhP genius, but when I check the 2 pages being used to generate the rss (wp-rss.php and wp-rss2.php) I can see that pubdate is formatted as follows:

    <pubDate><?php echo mysql2date(‘D, d M Y H:i:s +0000’, get_post_time(‘Y-m-d H:i:s’, true), false); ?></pubDate>

    Does this mean that the +0000 is hard-coded and that the adjustments to UTC I make are in fact ignored?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    No. The date in the RSS feed is the unadjusted UTC date. Did you make the post in question at 11 am in your time zone, or did you make it at 1 pm instead?

    Every post has *two* timestamps attached to it. One is your local time, the other is the GMT time that you made the post at.

    When you see get_post_time('Y-m-d H:i:s', true), that “true” means that it’s getting the GMT time from the database and using that number.

    The adjustments you make to the UTC value only affect the local timestamp. The time you made the post is absolute, you made it at a specific time, and the GMT time reflects that exact moment in reality, regardless of what timezone you were in.

    Thread Starter bannerninja

    (@bannerninja)

    I made the post at 1pm in my timezone, so that is what I would expect the RSS feed to show as well, as that data is what local people will see the posting being made at as well.

    But if this is WAI, I guess there isn’t much I can do about it then :/

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    I made the post at 1pm in my timezone, so that is what I would expect the RSS feed to show as well

    Okay, so now I’m confused. That is exactly what it is showing. 1 pm UTC+2 = 11 am UTC. And that’s the time it is showing, no?

    Maybe you wanted it to be
    <pubDate>Wed, 13 Jun 2007 13:10:04 +0200</pubDate>
    instead? Because that would be 1 pm in your local timezone.

    Anyway, RSS Feeds generally show UTC timestamps. While it’s within spec to have other time zones there, it’s fairly common to only include UTC times.

    Edit: There has talk about changing this behavior on wp-hackers in the last couple of months. So a future revision may change it to use your local timestamp and timezone instead.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘RSS pubdate not updated with UTC adjustment’ is closed to new replies.