You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears this issue goes beyond date_default_timezone_get() although it's certainly a good start. It appears the change was not fully intentional or is complicated as per php/php-src#11496 -- in any case, this issue certainly deserves more digging into.
When I opened this issue I was not sure where to open it. I've yet identified this change and collateral effect.
When we try to check timezone effect on our server , we catch this inconsistance as :
before 8.2 ini_get("date.timezone") is empty and date_default_timezone_get() return timezone server
after 8.2 ini_get("date.timezone") is no more empty and return UTC , date_default_timezone_get() do same
To prevent developer to misunderstood this change, could be interesting to provide an "official" note as it's a breaking change.
An other effect we can't anymore detect if configuration is forced/configured to UTC or without any configuration. To detect this only solution looks to check all configuration file (php.ini, pool.d/*, ...)
This really should be noted, both on DateTime page, and in the upgrade appendices.
Just did a pretty big update fra 8.1 to 8.4, and now have a lot of work to fix all the incorrect timestamps in our backend, and we have gone through the appendices with utmost care to avoid situations exactly like this.
Not to mention the time it took to determine what had actually happened.
Activity
philip commentedon Mar 25, 2025
It appears this issue goes beyond
date_default_timezone_get()although it's certainly a good start. It appears the change was not fully intentional or is complicated as per php/php-src#11496 -- in any case, this issue certainly deserves more digging into.camlafit commentedon Mar 26, 2025
Hello
When I opened this issue I was not sure where to open it. I've yet identified this change and collateral effect.
When we try to check timezone effect on our server , we catch this inconsistance as :
ini_get("date.timezone")is empty anddate_default_timezone_get() return timezone serverini_get("date.timezone")is no more empty and return UTC ,date_default_timezone_get()do sameTo prevent developer to misunderstood this change, could be interesting to provide an "official" note as it's a breaking change.
An other effect we can't anymore detect if configuration is forced/configured to UTC or without any configuration. To detect this only solution looks to check all configuration file (php.ini, pool.d/*, ...)
Maybe could be set also at https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
FlyveHest commentedon Apr 9, 2025
This really should be noted, both on DateTime page, and in the upgrade appendices.
Just did a pretty big update fra 8.1 to 8.4, and now have a lot of work to fix all the incorrect timestamps in our backend, and we have gone through the appendices with utmost care to avoid situations exactly like this.
Not to mention the time it took to determine what had actually happened.
Update example configuration (set timezone)