#22418 [Asn]: TimeZone.php always returns UTC on Windows
| From: | pajoye@php.net | Date: | Sat, 16 Aug 2003 19:14:34 +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-19904@lists.php.net to get a copy of this message | ||
ID: 22418
Updated by: pajoye@php.net
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:
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
Previous Comments:
------------------------------------------------------------------------
[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 :)
------------------------------------------------------------------------
[2003-04-06 23:24:22] akimoto at share360 dot com
Windows seems only accept 3 letters timezone, unless you use Windows
specific names as pear suggested.
Another possible fix suggestion is to cut more than 3 letters timezone
name before giving it to Windows, like,
"EBST3EBDT" -> "EBS3EBD"
I am not fully sure, but if this works okay, this is easier to maintain
as we could keep the same timezone list, instead of having two lists
for Windows and non-Windows platforms.
------------------------------------------------------------------------
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