Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetTimeZoneInformation broken?

84 views
Skip to first unread message

Kim Gräsman

unread,
Mar 27, 2008, 3:41:04 PM3/27/08
to
Hello,

I'm running Windows XP SP2 with all released patches.

For some reason, GetTimeZoneInformation has started returning bogus values
for me regarding DST settings.

I've attempted to disable DST by unchecking the "Automatically adjust clock
for daylight saving changes", and according to the documentation [1] this
should cause GetTimeZoneInformation to return TIME_ZONE_ID_UNKNOWN. I'm currently
getting TIME_ZONE_ID_DAYLIGHT, which seems way off base, as we're currently
in standard time here in Sweden.

The documentation further states that the wMonth member of StandardDate and
DaylightDate should be zero if DST is not in effect for the zone [2]. This
has also changed; I'm currently getting 10 (October) for both. The biases
are both zero, however.

This may not sound like a big deal, but I work with very time-sensitive applications,
and we have a lot of calculations around timezones, DST, transition dates,
etc, that rely on this behavior to be consistent.

I'm currently suspecting that a patch has changed the behavior of GetTimeZoneInformation,
or maybe just the timezone database in the registry -- due to all the random
DST changes around the world...

Does anyone have any ideas what I can do to isolate where this changed? Is
there a support alias for reporting issues like these?

Many thanks,
- Kim

[1] http://msdn2.microsoft.com/en-us/library/ms724421(VS.85).aspx
[2] http://msdn2.microsoft.com/en-us/library/ms725481(VS.85).aspx


Kim Gräsman

unread,
Mar 27, 2008, 3:58:12 PM3/27/08
to
Hi again,

OK, so GetTimeZoneInformation is in kernel32.dll, and my version has the
following stats:

File Version: 5.1.2600.3119 (xpsp_sp2_gdr.070416-1301)
Modified: 2007-04-16 16:52:53
Size: 984 576 bytes

It feels a little far-fetched that GetTimeZoneInformation would have changed,
but it also seems strange that updates to the timezone database would alter
its behavior to this effect.

My current timezone settings are: (GMT+01:00) Amsterdam, Berlin, Bern, Rome,
Stockholm, Vienna, and I've disabled "Automatically adjust..."

Thanks,
- Kim

m

unread,
Mar 27, 2008, 6:03:16 PM3/27/08
to
I have also seen problems with GetTimeZoneInformation bogus data. In my
case, it returns the correct time zones, but incorrect bias values.
Fortunatly for me, I only need to use this only for display to the user so I
just display the values and hope that the OS will fix this issue in the
future.


"Kim Gräsman" <k...@mvps.org> wrote in message
news:ba04e565afa28...@news.microsoft.com...

Kim Gräsman

unread,
Mar 28, 2008, 3:51:17 AM3/28/08
to
Hi m,

> I have also seen problems with GetTimeZoneInformation bogus data. In
> my case, it returns the correct time zones, but incorrect bias values.
> Fortunatly for me, I only need to use this only for display to the
> user so I just display the values and hope that the OS will fix this
> issue in the future.

Yeah, it's slightly more critical for me...

I tried on a variety of machines this morning, and all XP machines exposed
the same problem. The single Vista machine I tried behaved as expected, in
agreement with the docs.

- Kim


Jochen Kalmbach [MVP]

unread,
Mar 28, 2008, 6:22:05 AM3/28/08
to
Hi Kim!

>> I have also seen problems with GetTimeZoneInformation bogus data.

Maybe one of Michels posts help:
http://www.google.de/search?q=GetTimeZoneInformation+site%3Ablogs.msdn.com%2Fmichkap

If not, you can also contact him...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Kim Gräsman

unread,
Mar 28, 2008, 10:16:37 AM3/28/08
to
Hi Jochen,

> Maybe one of Michels posts help:
> http://www.google.de/search?q=GetTimeZoneInformation+site%3Ablogs.msdn
> .com%2Fmichkap
> If not, you can also contact him...

Thanks! Michael looks like he knows what strings to pull, at least. I'll
try to get in touch with him...

- Kim


0 new messages