#44257 [Opn->Asn]: [PATCH] timelib_tz_lookup_table must use float for gmtoffset
| From: | derick@php.net | Date: | Tue, 26 Feb 2008 22:38:42 +0000 |
| Subject: | #44257 [Opn->Asn]: [PATCH] timelib_tz_lookup_table must use float for gmtoffset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122727@lists.php.net to get a copy of this message | ||
ID: 44257
Updated by: derick@php.net
Reported By: iuri dot fiedoruk at hp dot com
-Status: Open
+Status: Assigned
Bug Type: *General Issues
Operating System: Windows XP
PHP Version: 5.2.5
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2008-02-26 20:55:30] iuri dot fiedoruk at hp dot com
Description:
------------
In ext/date/lib/timelib_struct.h you have:
typedef struct _timelib_tz_lookup_table {
char *name;
int type;
int gmtoffset;
char *full_tz_name;
} timelib_tz_lookup_table;
But in ext/date/lib/fallbackmap.h you can notice some timezones are
declared with offsets non-integer like:
{ "ist", 0, 5.5, "Asia/Calcutta" },
This break get_default_timezone function that reverts to UTC for those
values that are non-integer. The fix is easy, just change gmtoffset to
float:
typedef struct _timelib_tz_lookup_table {
char *name;
int type;
int gmtoffset;
char *full_tz_name;
} timelib_tz_lookup_table;
I've tested under Visual Studio 2005 Express and with this change
date_default_timezone_get() works fine now.
If there is a place to send patches, please tell me and I'll gladly
submit.
Reproduce code:
---------------
Run date_default_timezone_get() in a Windows machine with a non-integer
timezone (for example calcutah +5:30)
Expected result:
----------------
Shold return IST
Actual result:
--------------
Returns UTC
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44257&edit=1