Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16234 invoked from network); 12 Dec 2011 15:00:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2011 15:00:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=chortos@inbox.lv; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chortos@inbox.lv; sender-id=pass Received-SPF: pass (pb1.pair.com: domain inbox.lv designates 89.111.3.84 as permitted sender) X-PHP-List-Original-Sender: chortos@inbox.lv X-Host-Fingerprint: 89.111.3.84 shark4.inbox.lv Received: from [89.111.3.84] ([89.111.3.84:34968] helo=shark4.inbox.lv) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/36-17834-C1716EE4 for ; Mon, 12 Dec 2011 10:00:47 -0500 Received: from mail.inbox.lv (pop [10.0.1.110]) by shark4-plain.inbox.lv (Postfix) with ESMTP id E9DF622BF1; Mon, 12 Dec 2011 17:00:40 +0200 (EET) Received: from [192.168.1.139] (unknown [77.38.233.95]) (Authenticated sender: chortos@inbox.lv) by mail.inbox.lv (Postfix) with ESMTPSA id 909121CF65; Mon, 12 Dec 2011 17:00:40 +0200 (EET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Mon, 12 Dec 2011 17:00:40 +0200 Cc: Evert Pot , internals@lists.php.net Content-Transfer-Encoding: 7bit Message-ID: References: To: Pierre Joye X-Mailer: Apple Mail (2.1084) X-Virus-Scanned: OK Subject: Re: [PHP-DEV] Local time zone From: chortos@inbox.lv (Oleg Oshmyan) > I do not think it is too much asking to an admin to setup the correct > default timezone in php.ini on install, or to allow users to set it for > their virtual hosts via the usual interface. We are not talking only about servers here. We are mainly talking about personal machines, including laptops of people who travel often. Of course it is possible to just say that whenever one changes the system time zone, one should also change the time zone in php.ini. But that becomes tedious, and if PHP's guessing algorithm works for some people, why not let them use it? > It is totally unreliable and has caused so many troubles (and consumed > many of our debugging time). I have proposed a couple of improvements, in particular one that could resolve some DST issues (using tzname to get two abbreviation hints). And by making it even more explicit that the algorithm performs but a guess, for example, by moving it to a function with 'guess' in the function name, bug reports of the sort 'the guess is wrong' can be given a very low priority if not closed right away. Finally, the unreliability of the guessing algorithm is exactly why I proposed using system-provided local time descriptions/APIs. This issue boils down to: people want software to behave the same way whichever language it is written in. Things written in Bourne shell, cmd.exe, C, Perl, Python, Ruby all use the system time zone, or at least that which was the system time zone when the program made its first call to a function like localtime. Even MySQL has a time zone called SYSTEM and uses it by default. PHP is the odd man out: not only does it not use the system time zone by default, as it instead tries to find one in its own time zone database that seems most similar, but it is also going to remove the only ready way to get any close to getting the system time zone in the next release. -- Oleg