Forums

Google XML Sitemaps
[Plugin:Google XML Sitemap]False Time (8 posts)

  1. Monika
    Member
    Posted 8 months ago #

    Deine Sitemap wurde zuletzt am 21.09.2011 >>>08:24<<<< erstellt.

    This is false: it wasn't 8:24 it was 10:24 => two hours later
    Dashboard=>Options=>Timezone Berlin

    How can I resolve this?

    thanks a lot

    Monika

    http://wordpress.org/extend/plugins/google-sitemap-generator/

  2. WebDragon
    Member
    Posted 8 months ago #

    likewise here: Your sitemap was last built on 2011-09-29 8:20 pm. except it's 4:20pm here right now.

    the xml sitemap generator appears to be using UTC time and not respecting the timezone settings under Settings>General

    this is in error and should be fixed.

  3. drewstroikus
    Member
    Posted 8 months ago #

    Actually, this appears to be a WordPress bug.

    His code is requesting the modified time of the file and assigning to $ft using PHP's filemtime() function.

    He then asks PHP format the date and time using the date() function and WordPress' get_option function:

    date(get_option('date_format'),$ft) . " " . date(get_option('time_format'),$ft)

    The PHP date() function should read the default timezone and report the proper time, but instead it's returning the UTC time as evidenced by examining the output of date_default_timezone_get() - it's showing 'UTC' even though the blog is set to 'America/New_York'...

    This means WordPress is not setting the default timezone in time or at all when the plugin runs...

    No?

  4. drewstroikus
    Member
    Posted 8 months ago #

    Interestingly enough, while WordPress does request/set the timezone in the settings page, it never makes use of it in the core architecture. So everything gets UTC time when time is requested.

    I added the following to the very bottom of my wp-config.php and now my timestamps are correct...

    /** Set default timezone so all date/time functions report back properly */
    date_default_timezone_set(get_option('timezone_string'));

    Voila!

  5. NaturalSociety
    Member
    Posted 7 months ago #

    Hey guys, this may fix my google XML sitemap problem. Do you remember what the default timezone was for wordpress 3.2.1?

    What time zone needs to be set for the plugin to work properly?

    I am getting these errors, and although it may not appear to be timezone related, the errors started happening right after I switched my timezone. But, if you have any other solutions, let me know as well.

    http://naturalsociety.com/wp-content/uploads/sitemapgooglexml.png

    Thanks
    -Mike

  6. NaturalSociety
    Member
    Posted 7 months ago #

    Update: Think I got it, was just simply UTC. It didn't seem to have fixed my google xml sitemap issue. If anyone of you have any solutions, feel free to let me know.

  7. wheelndealin
    Member
    Posted 6 months ago #

    drewstroikus, you are the best. I have been frustrated with this utc time issue in the google xml sitemaps for some time now and your recommendation to put that code into the bottom of wp-config.php did the trick for me. I had to do a little research to find out what wp-config.php is but when i figured that out and installed, i can now see when my last xml sitemap update was so that i don't keep rebuilding unnecessarily.

    For those who are confused by wp-config.php it is the file in your hosting account which is a text document that you need to edit. My wp-config.php file is under the "ftp file manager" in GoDaddy.

    Thanks,
    Nick Graff, CCIM

  8. ZinZangStudio
    Member
    Posted 6 months ago #

    Thanks, drewstroikus!

    Minor issue, yet majorly aggravating. All fixed now.

Reply

You must log in to post.

About this Plugin

About this Topic