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, firstname.lastname@example.org
- Status: Under Discussion
- First Published at: https://wiki.php.net/rfc/date.timezone_warning_removal
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. Sure, there exists “-ddate.timezone=UTC”, but you usually forget to explicitly specify it and then are annoyed about it.
Generally warning should be there there to guide the user when developing. Just like superfluous warnings confuse him.
Thus, I'd like to remove this warning in favor of a better user experience.
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. (In this case PHP 7, being a major too.)
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 (50%+1 vote):