On 23/05/13 20:40, Daniel Lowrey wrote:
> If it's going to default to UTC anyway should there really be an
> E_WARNING? Can't PHP just quietly use UTC? The "U" in UTC *does*
> stand for "Universal," after all. It's a sensible default and as
> such shouldn't merit a warning.

Actually, the sensible default is what guess_timezone() does already,
except without the warnings. You can get that behaviour with e.g.

date_default_timezone_set( @date_default_timezone_get() );

at the top of your program. That's what MediaWiki does (except with by
modifying error_reporting instead of using @). We stole the idea from
another web app. It's more convenient than duplicating the
functionality of guess_timezone() in the application.

It's Derick's prerogative to annoy all users half to death with
warnings, as his way of indicating his distaste for the state of OS
support for querying of system timezone. That's the reward we give him
for writing lots of date/time code.

-- Tim Starling

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to