Skip to main content

PHP timezone not uniformly applied

Comments

11 comments

  • cPRex Jurassic Moderator
    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
  • eLIANT
    WordPress: Settings>General>Timezone Log: /home//public_html/error_log time stamp of example entry: "[08-Apr-2022 21:46:00 UTC] "
    0
  • cPRex Jurassic Moderator
    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
  • eLIANT
    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
  • cPRex Jurassic Moderator
    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
  • eLIANT
    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
  • cPRex Jurassic Moderator
    Can you let me know the ticket number so I can follow along with that on my end?
    0
  • eLIANT
    94438127
    0
  • cPRex Jurassic Moderator
    Thanks for that - I'm following along on my end as well.
    0
  • kjg
    Any update on this. We have the same problem.
    0
  • cPRex Jurassic Moderator
    @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.