Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67510 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28011 invoked from network); 25 May 2013 10:31:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2013 10:31:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=tstarling@wikimedia.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tstarling@wikimedia.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain wikimedia.org designates 208.80.152.186 as permitted sender) X-PHP-List-Original-Sender: tstarling@wikimedia.org X-Host-Fingerprint: 208.80.152.186 mchenry.wikimedia.org Received: from [208.80.152.186] ([208.80.152.186:60206] helo=mchenry.wikimedia.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/40-25010-00390A15 for ; Sat, 25 May 2013 06:31:29 -0400 Received: from [2620:0:860:2:219:b9ff:fedd:86eb] (port=35161 helo=sanger.wikimedia.org) by mchenry.wikimedia.org with esmtp (Exim 4.69) (envelope-from ) id 1UgBl0-0001QP-JQ for internals@lists.php.net; Sat, 25 May 2013 10:31:26 +0000 Received: from ip4daa59e3.direct-adsl.nl ([77.170.89.227]:58480 helo=[192.168.2.23]) by sanger.wikimedia.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UgBkz-0000wk-SX for internals@lists.php.net; Sat, 25 May 2013 10:31:26 +0000 Message-ID: <51A092FC.4010700@wikimedia.org> Date: Sat, 25 May 2013 12:31:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: X-Enigmail-Version: 1.4.6 OpenPGP: id=BF976370 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] date.timezone E_WARNING -- Really necessary? What's the rationale? From: tstarling@wikimedia.org (Tim Starling) 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