Re: date.timezone E_WARNING -- Really necessary? What's the rationale?

From: Date: Sat, 25 May 2013 10:31:24 +0000
Subject: Re: date.timezone E_WARNING -- Really necessary? What's the rationale?
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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


Thread (70 messages)

« previous php.internals (#67510) next »