WP timezone change effecting post publishing

Discussion in 'Web Design' started by drding, Nov 26, 2013.

to remove all ads.
  1. drding

    drding New Member

    Messages:
    29
    Here's an odd one.

    I'm working on a WP site with a custom built theme. The site itself would be updating with a post once a week at midnight.

    Due to the design, the timestamps of posts and comments are displayed, which is fine except we still had the timezone set at the default UTC+0 that WP installs with. Simple change though right?

    So we set the timezone for UTC-5 (New York) about a week ago and I figure all is well.
    The site owner yesterday evening set a post up a few hours before midnight to post on 11/26 at 00:05. This time rolls around and there's no post. He actually had to back date the post to the day before for it to publish.

    I think, well maybe I set the timezone wrong, let me go with the "New York" option instead of the UTC time. He still wasn't able to publish it for today (11/26).

    I ended up putting the timezone back to UTC+0 and he was able to publish again for today.

    I'd leave it, but again the timestamps are not right for our zone. Any ideas what might be going on?
    He was able to set up scheduled posts before we changed the timezone, so he does know the steps to do it correctly.

    Here's something else that might be helpful, I have a complete version of the site on my local WAMP server. I set the timezone for "New York" and created a dummy post and scheduled it for like 1:45 am and it posted at the scheduled time.
    The live site is hosted on GoDaddy.
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    What is the server time set to?
     
  3. Phreaddee

    Phreaddee Super Moderator Staff Member

    Messages:
    1,978
    yes, I've had this issue before and it was in relation to the time settings on the (virtual) server which were wrong.
     
  4. drding

    drding New Member

    Messages:
    29
    I'm not sure exactly what the server time is. I tried looking over the management control panel and as far as I know it's not stated anywhere that's easy to find.

    We tried setting it to the New York option again and scheduled a post on the live server for tonight that ended up posting on time. I guess there's just something not quite right with using the UTC-5 option?

    I'm just happy the site is able to post and it's now displaying the correct time. Weird though. I would think both timezone options (UTC-5 vs New York) would work the same.
     
  5. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    Put
    PHP:
    <?php echo date("D M d, Y H:i a"); ?>
    in a PHP document and run it.
     
  6. drding

    drding New Member

    Messages:
    29
    Here's what I got:

    Tue Dec 03, 2013 19:31 pm
     
  7. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    And????


    How does that compare to your local time zone??

    Bearing in mind that the forum shows you posted "Today 02:34 AM" which is GMT (my time zone setting)
     
  8. drding

    drding New Member

    Messages:
    29
    I like to build the suspense.

    At the time I set up that php page it was about 9:31 pm. So 19:31 is like 7:31 pm?

    With that in mind midnight for me would equal to 10:00 pm server time I guess?

    So we'll say the timezone is set back to UTC-5, what should equate to the time in NY. And we'll say a post is set for 00:05 or 12:05 am (of the next day). If that timezone setting is being affected by the server time then it's still technically the day before by the time it's midnight by me.

    That post might publish then at like 2:05 am my time then if I'm thinking about this right.

    I'm getting that UTC-5 from here by the way: http://www.timeanddate.com/worldclock/city.html?n=179
     
  9. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    Or set your time zone for PHP to New York with

    PHP:
    date_default_timezone_set('America/New_York');
    In index.php
     

Share This Page