WordPress.org

Ready to get started?Download WordPress

Forums

Date and Time does not change (5 posts)

  1. michaeljdornan
    Member
    Posted 1 year ago #

    Hi, I have a theme that displays the date and day on the homepage, this has always been out about 11 hours (the server is in HK, I am in Australia).

    The theme used the below code to pull in the date and time:

    <div id="date"><?php localize_date(WPLANG); ?></div>

    I have now changes that to the following to give me more accurate understanding how far out the clock is:

    <div id="date"><?php echo date('l jS \of F Y h:i:s A'); ?></div>

    I have tried going into general settings and amending the timezone, the date does not change at all! no matter what I change it to.... I am running WPMU, I expected the date and time to be set in the Network Admin Dashboard, but it's not there, so I go into the first, main site and change it there (Dashboard> General > Timezone...

    It's almost like this is the wrong place or something, but I can't figure out why it won't change.

    Any ideas?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Try using:

    <div id="date"><?php the_time(get_option('date_format')); ?> <?php the_time(get_option('time_format'));?></div>

  3. michaeljdornan
    Member
    Posted 1 year ago #

    Thanks, but thats put the date and time way way out, I changed the timezone in the settings to be Hong Kong, it shows the following beside:

    UTC time is 2012-10-09 23:03:46 Local time is 2012-10-10 7:03:46

    But shows this on the homepage - October 7, 2012 8:59 pm

    And if I change the timezone to something on the other side of the world, the theme time stays at October 7, 2012 8:59 pm

    Odd? Can I not have it take the local computers date and time?

    Thanks

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    No - it picks up the date from the server. Have you checked with your hosts to see if there's an issue with the server's time?

  5. michaeljdornan
    Member
    Posted 1 year ago #

    Ok, I have confirmed the time on the server is 100% correct... it's located in HK and is set to HK time.

    I think it might be something to do with WPMU, as I say, when i change the timezone it never changes the time on the homepage of the site??

Topic Closed

This topic has been closed to new replies.

About this Topic