Bug #17228 Updated: timezone incorrect in date
| From: | darron at kewl dot org | Date: | Tue, 14 May 2002 23:53:05 +0000 |
| Subject: | Bug #17228 Updated: timezone incorrect in date | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7698@lists.php.net to get a copy of this message | ||
ID: 17228
Updated by: darron@kewl.org
Reported By: darron@kewl.org
Status: Open
Bug Type: Date/time related
Operating System: solaris 2.7
PHP Version: 4.1.2
New Comment:
The quick fix may only be valid for the UK (GMT/BST)
The altzone offset may be a better indicator that GMT
is not the correct local timezone elsewhere.
Previous Comments:
------------------------------------------------------------------------
[2002-05-14 19:15:36] darron@kewl.org
The following:
print date( "r Z T", time() );
print gmdate( "r Z T", time() );
Gives this output:
Tue, 14 May 2002 22:56:09 +0100 3600 GMT
Tue, 14 May 2002 21:56:09 +0000 0 GMT Standard Time
Comment:
Internally solaris creates an integer named
daylight after localtime() is called if an
alternate time zone is in use.
PHP ignores this and always uses tzname[0]
Quick fix:
diff ext/standard/datetime.c~ ext/standard/datetime.c
256c256,259
< tname[0] = tzname[0];
---
> if( daylight )
> tname[0] = tzname[1];
> else
> tname[0] = tzname[0];
After patching the PHP code produces:
Wed, 15 May 2002 00:13:40 +0100 3600 BST
Tue, 14 May 2002 23:13:40 +0000 0 GMT Standard Time
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17228&edit=1