|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-13 16:00 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 09:00:01 2025 UTC |
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