3

On the "General Settings" page of my WordPress site, it's not displaying the correct UTC and local times (see screenshot below).

enter image description here

The displayed UTC and local times are wrong. It should say that local time is "15:52"

  • I'm running WordPress 4.9.6 and PHP 7.0.30.
  • The default timezone in my "php.ini" file is set correctly--when I call the date() and date_default_timezone_get() functions from a standalone PHP script, they output the correct information.
  • The clock on my Windows web server is correct and is set to the correct timezone.
  • The time displays incorrectly when I call the following WordPress function (it is 4 hours behind what it should be): current_time('Y-m-d H:i').

This thread says the problem is caused by a bad plugin. I actually had that particular plugin installed, but deactivating (and then deleting) the plugin didn’t fix the issue for me.

This thread says it’s due to the server’s timezone definitions being corrupted. It provides instructions on how to fix this for Linux, but not Windows. However, I have other WordPress sites hosted on the same server, and they do not have this issue.

Issue has been cross-posted here: https://wordpress.org/support/topic/timezone-settings-utc-and-local-times-are-incorrect/

1 Answer 1

0

This is set inside your database and is also used inside PHP settings on the server. Double check the PHP settings if you can control them. There is a timezone parameter that you can enter into PHP.ini (PHP -v shows you all of this). For MySQL... You'd need to look at global setting which I'm forgetting at the moment.

4
  • The date.timezone setting in my "php.ini" file is set correctly. Also, system_time_zone and time_zone variables in my MySQL server are set correctly.
    – Michael
    Commented Jun 21, 2018 at 15:59
  • What about Linux settings? Commented Jun 21, 2018 at 19:57
  • I'm running Windows.
    – Michael
    Commented Jun 22, 2018 at 13:42
  • No idea. I do not use Windows for production Commented Jun 23, 2018 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.