Forums

WordPress Timezone Problems (2 posts)

  1. singpolyma
    Member
    Posted 2 years ago #

    Hello :)
    I am working on setting up a self-hosted WordPress blog, and am running into some problems:

    1) Changing the timezone setting does not change the displayed time of existing posts/comments
    2) When I use O in a time format (ie, the timezone offset) or any other timezone-displaying format it shows my server timezone instead of my set timezone
    3) When I use U to output a unix timestamp it outputs in such a way that it is off from UTC by the difference between my set timestamp and my server timestamp

    Some thoughts by others are found here (http://gregcerveny.com/20061129/wordpress-times-time-zones-and-daylight-savings/) and more importantly here: (http://www.makeyougohmm.com/20070125/4178/)

  2. singpolyma
    Member
    Posted 2 years ago #

    Adding this line to the top of my template fixes the problem (or so it seems anyway):

    <?php echo (int)date_default_timezone_set('America/New_York'); ?>

    However I have to remember to keep this code in synch with my settings, and certainly cannot distribute a template with this line in it...

Topic Closed

This topic has been closed to new replies.

About this Topic