#44257 [NEW]: [PATCH] timelib_tz_lookup_table must use float for gmtoffset

From: Date: Tue, 26 Feb 2008 20:55:30 +0000
Subject: #44257 [NEW]: [PATCH] timelib_tz_lookup_table must use float for gmtoffset
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122726@lists.php.net to get a copy of this message
From: iuri dot fiedoruk at hp dot com Operating system: Windows XP PHP version: 5.2.5 PHP Bug Type: *General Issues Bug description: [PATCH] timelib_tz_lookup_table must use float for gmtoffset 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 bug report at http://bugs.php.net/?id=44257&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44257&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44257&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44257&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44257&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44257&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44257&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44257&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44257&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44257&r=support Expected behavior: http://bugs.php.net/fix.php?id=44257&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44257&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44257&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44257&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44257&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44257&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44257&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44257&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44257&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44257&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44257&r=mysqlcfg

« previous php.bugs (#122726) next »