WordPress.org

Ready to get started?Download WordPress

Forums

RSS timezone issue (4 posts)

  1. davesgonechina
    Member
    Posted 10 years ago #

    My server is in the U.S., I'm in China. Though my posts have a China timestamp (i.e. 8pm), my RSS feed have a U.S. timestamp(8a.m.). It's causing problems with people sorting through the feed, since it makes it look like I wrote something 12 hours in the future. I think something must change here:
    <?php /* These first lines are the first part of a CafeLog template.
    In every template you do, you got to copy them before the CafeLog 'loop' */
    $blog = 1; // enter your blog's ID
    $doing_rss = 1;
    header('Content-type: text/xml', true);
    require('wp-blog-header.php');
    // Get the time of the most recent article
    $maxdate = $wpdb->get_var("SELECT max(post_date) FROM $tableposts");
    $unixtime = strtotime($maxdate);
    // format timestamp for Last-Modified header
    $clast = gmdate("D, d M Y H:i:s \G\M\T", $unixtime);
    $cetag = (isset($clast)) ? md5($clast) : '';
    Any advice?

  2. davesgonechina
    Member
    Posted 10 years ago #

    whoops, I was wrong. That's not the right section. My posts display the right time, the RSS feed does not - now I think it's somewhere in the code of templates_functions.php, like in the_time function cuz RSS appears to use that.
    function the_time($d='', $echo = true) {
    global $id, $post, $timeformat;
    if ($d=='') {
    $the_time = mysql2date($timeformat, $post->post_date);
    } else {
    $the_time = mysql2date($d, $post->post_date);
    }
    $the_time = apply_filters('the_time', $the_time);
    if ($echo) {
    echo $the_time;
    } else {
    return $the_time;
    }
    Shouldn't this incorporate time_difference? Is it already incorporated in the post_date? Why then does my feed say it's a day off to everyone else?
    My page: http://silkworms.chinesetriad.org
    The blog aggregator that this is a problem for: http://www.livinginchina.com/aggregator.shtml

  3. Anonymous
    Unregistered
    Posted 9 years ago #

    Did you make any progress on this? I'd love to let each post properly reflect the time and timezone of the person posting, so it doesn't look like I'm posting at 2am if I'm outside the US.

  4. chedong
    Member
    Posted 8 years ago #

    RSS time zone issue: GMT time + GMT time zone or local time + local time zone

    I subscribe some feed published by wordpress: I found the timezone problem. the post always shown published tomorrow.

    current wordpress default pubDate field is localtime + GMT timezone:
    <pubDate>Wed, 25 May 2005 09:32:44 +0000</pubDate>
    but feed publish in China: it should be
    <pubDate>Wed, 25 May 2005 09:32:44 +0800</pubDate>
    or convert time to GMT and +0000
    <pubDate>Wed, 25 May 2005 01:32:44 +0000</pubDate>

    Thanks

    Che Dong
    http://www.chedong.com

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.