This is an old revision of the document!
PHP RFC: Remove the date.timezone warning
- Version: 1.0
- Date: 2015-01-27
- Author: Bob Weinand, bobwei9@hotmail.com
- Status: Under Discussion
- First Published at: https://wiki.php.net/rfc/date.timezone_warning_removal
Introduction
Each time we use date() or generally functions which make use of the date.timezone ini setting, we get a warning. Even when only just trying to try something small with PHP cli involving dates, especially without a default php.ini installed, we can't just get nice output without an annoying warning.
Thus, I'd like to remove this warning in favor of a better user experience.
Proposal
Removing the date.timezone warning in case the date.timezone ini setting is empty.
The date.timezone warning has this text:
It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.
Proposed PHP Version(s)
Targeting the next minor version.
Unaffected PHP Functionality
If the date.timezone ini setting is set but invalid, a warning is still thrown. The default is and remains UTC.
Proposed Voting Choices
Remove this warning:
- Yes
- No
Patch
References
There are enough requests to remove this: