Re: date.timezone E_WARNING -- Really necessary? What's the rationale?
| From: | Levi Morrison | Date: | Fri, 24 May 2013 19:18:54 +0000 |
| Subject: | Re: date.timezone E_WARNING -- Really necessary? What's the rationale? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67504@lists.php.net to get a copy of this message | ||
> "If none of the above succeed, date_default_timezone_get() will return a
> default timezone of UTC."
It will still raise a warning, by the way. This is horrible behavior;
I recommend the following:
date_default_timezone_set(ini_get('date.timezone') ?: 'UTC');
This is basically what date_default_timezone_get does as of PHP 5.4
except there is no warning.