On Fri, 7 Oct 2005, Nuno Lopes wrote:
> Uhm, sorry but it doesn't work well when I choose a timezone which has
> no DST. For an unknown reason, windows returns TIME_ZONE_ID_UNKOWN in
> that case, so PHP always returns UTC.
Can you check if in that case the elements in the struct that
GetTimeZoneInformation fills are correct?
> I've done some tests and the best way I found is simply (and removing the
> GetTimeZoneInformation() part):
> tzid = timelib_timezone_id_from_abbr("", (_daylight ? 3600 : 0) - _timezone,
> _daylight);
We can't use the _ things, because of thread safety, so we have to use
the win32 api function.
> Those vars are defined in time.h (already included).
> With this little piece of code I was able to get the correct date/time for
> 'Abu Dhabi' (+4, no DST). With the corrent code, UTC is returned.
>
> There are also other problems:
> Choosing 'Bangkok, Hanoi, Jakarta' (+7, no DST) leads to incorrect dates,
> because of the fallback table. It is recognised as 'Asia/Krasnoyarsk' (+8,
> DST), so it is always one hour advanced. So basically the second problem here
> is that the fallback table needs a big revision, to include all offsets, and
> to correct some no-DST timezones.
By all means, it's not working for 100% of the time. If we can improve
it that's fine ofcourse. But +7/no DST should not be found as +8/DST...
unless Windows fucks up again. Which windows are you using?
regards,
Derick
--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php