PHP timezone not uniformly applied
I want everything to display in Eastern timezone for all accounts on my server. Yes, there are many posts in this and other forums about this, but I can't find the combination of changes that makes everything work.
In server WHM (not account cPanel) I made the following changes:
I've set server time under Server Configuration.
I've updated date.timezone in MultiPHP INI Editor, using the Editor Mode tab.
In MultiPHP Manager, tab User Domain Settings, all domains set to inherit.
In cPanel of a particular existing (not new regarding inheritance) account, I made these changes:
In MultiPHP INI Editor, using the Editor Mode tab, I added the desired date.timezone value in /home//public_html/php.ini
In WordPress Settings, timezone is set as desired.
As a test, I added this to a custom 'init' function:
$T = date_default_timezone_get();
die($T);
Restarted server.
visited WordPress site previously mentioned.
On-screen result: UTC
Error logs are in UTC.
What am I missing?
-
Hey there! When you're checking WordPress, can you let me know which specific page? Can you also let me know which error log you're looking at? 0 -
WordPress: Settings>General>Timezone Log: /home//public_html/error_log time stamp of example entry: "[08-Apr-2022 21:46:00 UTC] " 0 -
Thanks for that. I checked the WordPress interface on one of my personal sites and confirmed that displayed properly as "America/Detroit" and the local error_log is also showing the correct timezone. Can you open a PHP Info page and confirm the ini file that is being read? 0 -
Running phpinfo() gives this informatoin: Configuration File (php.ini) Path /opt/cpanel/ea-php74/root/etc Loaded Configuration File /home//public_html/php.ini Additional .ini files parsed blah...blah..., ./php.ini (php.ini has this as its last line: date.timezone = "America/Detroit") phpinfo() displays in the "date" section... ... Default timezone America/Detroit But what do you mean by " the local error_log is also showing the correct timezone." I cause an intentional error and the error log updates but still has the UTC time stamp on the error line. BTW - wp_post table timestamps are correct (Detroit) 0 -
That's odd - everything sounds like it's configured correctly. Could you submit a ticket to our team so we can look into this? 0 -
After additional digging, it appears only the PHP error log displays the UTC timestamp on the individual lines. But that's still a problem. Ticket submitted. 0 -
Can you let me know the ticket number so I can follow along with that on my end? 0 -
94438127 0 -
Thanks for that - I'm following along on my end as well. 0 -
Any update on this. We have the same problem. 0 -
@kjg - this is a known issue with WordPress itself, and you can find more details on this here: Date/Time component improvements in WordPress 5.3 Specifically, this entry: "store Unix timestamps or formats that include time zone, such as DATE_RFC3339;" 0
Please sign in to leave a comment.
Comments
11 comments