#22418 [Asn]: TimeZone.php always returns UTC on Windows

From: Date: Sat, 16 Aug 2003 19:41:00 +0000
Subject: #22418 [Asn]: TimeZone.php always returns UTC on Windows
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19905@lists.php.net to get a copy of this message
ID: 22418 User updated by: pear at yogamala dot com Reported By: pear at yogamala dot com Status: Assigned Bug Type: PEAR related Operating System: Windows 2000 PHP Version: 4.3.1 Assigned To: pajoye New Comment: > Your solution is not crossplatform. Of course, it's windows specific. I don't understand your statement. > on how many win32 OSes did you try your patch? Windows 2000, Windows XP, others used it on Windows 98 with success. > Do you really think that include a win32 only file is a good thing? Yes. How else are you going to do it? I only include it if the system is Windows. Previous Comments: ------------------------------------------------------------------------ [2003-08-16 14:14:34] pajoye@php.net Hello, Your solution is not crossplatform. on how many win32 OSes did you try your patch? Do you really think that include a win32 only file is a good thing? pierre ------------------------------------------------------------------------ [2003-08-16 14:00:20] pear at yogamala dot com > win32 platforms do not have any standart (sic) for TZ. Yes it does. It's called the registry. > This patch does not fix the problem. It fixes the problem fine, and it is a "real" solution. And unless you can come up with a better solution, why not include it? It's works far better than TimeZone.php (see below) as Windows has standardized the timezones in the registry. Vaguely critizing a solution without an alternatively is not productive. IMHO, the TimeZone class is flawed. For example, BST is not a unique timezone identifier. In TimeZone.php, BST points to "Bangladesh Time", where in practice, it more often refers to "British Summer Time". Therefore, the whole class needs to be reworked. We spent several months trying to use TimeZone.php in tikiwiki.sf.net but finally gave up, as too many users reported problems. It's especially broken during the summer as it doesn't handle summer identifiers very poorly. I would strongly suggest you use date('Z') (timezone offset in seconds) instead to determine the timezone. It is far more reliable than date('T'). ------------------------------------------------------------------------ [2003-08-16 12:19:59] pajoye@php.net No See peardev archives for the status and "real" solutions. In a few words: win32 platforms do not have any standart for TZ. This patch does not fix the problem. The only good solution is to use the same TZ DB on all platforms (this solution is used by near all date/time related system). That means to use the public TZ DB. pierre ------------------------------------------------------------------------ [2003-08-16 11:35:21] cellog@php.net has this been fixed in cvs yet so it can be closed? ------------------------------------------------------------------------ [2003-04-28 04:05:39] arnaud@php.net IIRC pierre like Date :) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22418 -- Edit this bug report at http://bugs.php.net/?id=22418&edit=1

« previous php.pear.dev (#19905) next »