Re: date.timezone E_WARNING -- Really necessary? What's the rationale?
| From: | Levi Morrison | Date: | Sat, 25 May 2013 15:09:48 +0000 |
| Subject: | Re: date.timezone E_WARNING -- Really necessary? What's the rationale? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67518@lists.php.net to get a copy of this message | ||
>> It is actually only about getting safe, cross platform/OS (even
>> between Linux versions) for the TZ database. It has nothing to do
>> with taste or similar subjective opinion.
>>
>> For the record, the behavior requested in this thread is what we had
>> in earlier versions, all we got was plenty of bugs reports about
>> wrong TZ detections.
>>
>
> I had missed the removal of the TZ detection code from
> guess_timezone() in 5.4. So @date_default_timezone_get() is somewhat
> less useful than it used to be, as a function for detecting system
> settings.
>
>> I think it is not too much asking to set it in php.ini or in your
>> application.
>>
>
> At least for MediaWiki, it's certainly more important to avoid
> warnings than it is to have the right local timezone. UTC is used in
> any case where consistency is important. Based on other posts to this
> list, I don't think we're alone in this.
For the record, the PHP 5.4+ date_default_timezone_get is equivalent to
ini_get('date.timezone') ?: 'UTC'
except that date_default_timezone_get will raise a warning and the
above will not.