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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745483353a4629657.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