admin管理员组文章数量:1122846
On the "General Settings" page of my WordPress site, it's not displaying the correct UTC and local times (see screenshot below).
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()
anddate_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: /
On the "General Settings" page of my WordPress site, it's not displaying the correct UTC and local times (see screenshot below).
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()
anddate_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/
Share Improve this question edited Jun 20, 2018 at 18:15 Michael asked Jun 19, 2018 at 20:45 MichaelMichael 1312 silver badges6 bronze badges1 Answer
Reset to default 0This 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.
本文标签: Timezone Settings quotUTCquot and quotlocalquot times are incorrect
版权声明:本文标题:Timezone Settings: "UTC" and "local" times are incorrect 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283736a1927061.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论