admin管理员组文章数量:1431726
Both my server local time and timezone are correct (UTC -3).
$ date -u
Fri May 17 23:53:01 UTC 2019
$ date -Is
2019-05-17T20:53:10-03:00
$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 37 May 17 20:41 /etc/localtime -> /usr/share/zoneinfo/America/Sao_Paulo
$ cat /etc/timezone
America/Sao_Paulo
However, WordPress thinks my server is on UTC timezone and dials back 3 hours.
Timezone
Choose either a city in the same timezone as you or a UTC timezone offset.
Universal time (UTC) is
2019-05-17 19:38:06
. Local time is2019-05-17 16:38:06.
This timezone is currently in standard time. Daylight saving time begins on:
November 2, 2019 11:00 pm
.
How do I fix this?
Both my server local time and timezone are correct (UTC -3).
$ date -u
Fri May 17 23:53:01 UTC 2019
$ date -Is
2019-05-17T20:53:10-03:00
$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 37 May 17 20:41 /etc/localtime -> /usr/share/zoneinfo/America/Sao_Paulo
$ cat /etc/timezone
America/Sao_Paulo
However, WordPress thinks my server is on UTC timezone and dials back 3 hours.
Timezone
Choose either a city in the same timezone as you or a UTC timezone offset.
Universal time (UTC) is
2019-05-17 19:38:06
. Local time is2019-05-17 16:38:06.
This timezone is currently in standard time. Daylight saving time begins on:
November 2, 2019 11:00 pm
.
How do I fix this?
Share Improve this question edited May 17, 2019 at 23:53 That Brazilian Guy asked May 17, 2019 at 22:43 That Brazilian GuyThat Brazilian Guy 1,2413 gold badges19 silver badges43 bronze badges 3 |1 Answer
Reset to default 0Turns out there was a previous attempt to fix the timezone:
date_default_timezone_set('America/Sao_Paulo');
was called on the init
hook.
When later the correct UTC time, local time and timezone were properly set on the server, this caused a conflict.
Removing this solved the issue.
本文标签: WordPress detects the wrong timezone
版权声明:本文标题:WordPress detects the wrong timezone 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745483353a2660273.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
date -Is
guarantee that I'm getting the local time? Doesn't theT20:53:10-03:00
part indicates that? Am I mistaken here? Or do you mean something else? – That Brazilian Guy Commented May 17, 2019 at 23:55