-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTC Default timezone instead of server local timezone ? #11496
Comments
Hmm 🤔 something did indeed change in 8.2: 6770158 to make UTC the default if unspecified. I didn't find this in the documentation though. |
Well, thanks you for your answer, at least It enlightens me on this behavior. I know (and I should have use it) that with the But is this not a kind of breaking change ? If this is a bad practice to let this configuration untouched and let the server "decide" which TZ will be used in PHP, wouldn't it be better to make that deprecated in this minor version and definitely set the default value in next major version ? |
I don't know the full context of this. So I'll cc the author of the commit. cc @derickr |
I believe PHP would always have used UTC, even if it was empty. Some distributions change how PHP works in regard to timezones, and come up with a "timezone-local" moniker that isn't standard. That is however, a problem with how distributions patch PHP. For pure PHP, this should not have bea BC breaking change. |
This one tripped me up too using ubuntu 20.04 and upgrading PHP 7.4 to 8.2. I confirmed that on PHP 7.4, PHP uses the operating system's timezone. But, after upgrading to 8.2, it's using UTC and dates in logging and database were now shifted. While perhaps not an issue with core PHP, it sure would be nice for the upgrade notes to contain something about this because upgrading on a common OS (Ubuntu) seems to cause this. |
I too encountered a few application errors after upgrading from PHP version 8.1 to 8.3 due to timezone changing from server timezone to UTC. I agree with @mbniehues that the upgrade notes and change log should mention about this. |
Any chance this is going to get fixed? It is POSIX standard to inherit and execute in the timezone specified.
|
Description
After upgrading my php version from 8.1 to 8.2 I've noticed that the default timezone changed from the server local to UTC.
To be sure that it does not come from my server setup or my computer, i've set up 2 differents Dockerfile based on Ubuntu 22.04 and based on the same local timezone : one with php 8.1 and another with php 8.2.
The one with PHP 8.1 correctly use the container TZ while the other one use UTC.
I've also noticed the same behaviour with Ubuntu 18.04 and 20.04.
Is that a new behaviour of PHP8.2 ? Am I missing something ?
Be aware that php.ini config files are left untouched, they are by default.
Here are the Dockerfiles
PHP 8.1 :
Output :
PHP 8.2 :
Output :
PHP Version
PHP 8.2
Operating System
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: