WordPress detects the wrong timezone

Turns 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.

How to get WP to use EST Timezone

date() is unreliable in WP since it always resets time zone to UTC and uses its own processing for time zones. date_i18n() is usually preferable WP replacement, but it will also localize output, which might be unwanted. What you want for correct unlocalized output is to: Get data out of WP API without its offset … Read more