WordPress.org

Ready to get started?Download WordPress

Forums

where does WordPress get the time from? (6 posts)

  1. jberghem
    Member
    Posted 6 years ago #

    The time on the site settings page is off by 12 minutes on my server. I contacted my webhost who checked the MySQL server time and they claim it is on time. They asked me how they can reproduce the time generated by WordPress. Does anyone know where WordPress get the time from and where/how this can be set?

  2. mikey1
    Member
    Posted 6 years ago #

    Hi, as far as I am aware its set from your server depending on its location, this plugin may be of some help, not sure where you are.
    http://wordpress.org/extend/plugins/automatic-timezone/
    hope it helps.
    mike

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    WordPress gets its time from the webserver that it is running on, which may not be the same as the MySQL server.

    In PHP, have them run this to see what the server time is:
    <?php echo gmdate('Y-m-d G:i:s'); ?>

    That should output the current time on the server in GMT, which is what the time on their server should be set to.

    WordPress uses that time plus whatever offset you give it to determine your "local" time.

  4. jberghem
    Member
    Posted 6 years ago #

    @mikey1 - thanks for the response but my timezone is set properly, this is not an timezone issue. Timezones are always set with hours not minutes. In fact the half hour increments on the settings page are actually not necessary since there's always an hour difference between the zones, never a half hour. Therefore if the time is off by 12 and half minutes it means that either the server time or your PC time is not set to Internet time.

    @ Otto42 - Thank you I'll run it by my webhost. Hope this info helps them.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    In fact the half hour increments on the settings page are actually not necessary since there's always an hour difference between the zones, never a half hour.

    Not true. Many timezones in the world have half hour differences.

    But your point is valid nevertheless, a 12 minute difference means that your server time is wrong.

  6. jberghem
    Member
    Posted 5 years ago #

    @ Otto42 - I stand corrected, I didn't know that. There are even 15min. difference timezones.

    Anyway I got the time corrected by the webhost. Thanks for your help

    PS. I started this post but somehow it isn't giving me the option to change the status to "resolved"
    in my profile the Threads Started column stays empty when I post. It's all in the Recent Replies column

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags