Daylight savings time problem (affects code running in Australian timezones)


Stephen Ahn

Using dotnet 1.1 sp1,
Windows XP sp 2, with Windows auto update on.

Prerequisites to reproduce behaviour :

In control panel, set Windows timezone to :
GMT +10 Canberra, Melbourne, Sydney,
Tick : Automatically adjust clock for daylight saving changes,
set local date to correct local date (eg. 30 May 2006).

Then run following code :

DateTime dt = new DateTime(2005, 3, 31);
string xml = System.Xml.XmlConvert.ToString(dt);

xml contains :

This seems to be wrong (would expect : "2005-03-31T00:00:00.0000000+10:00"),
since 31 Mar 05 in Sydney was not in daylight savings time. The code seems
to be treating the date as though that date was daylight savings time.

If I run the code on another Windows XP (but which does not have latest
windows updates), the expected result with +10 shows up. Perhaps this
problem has something to do with the hotfix Microsoft recently provided for
Australia to adjust for the later end to daylight savings time in 2006 due
to the commonwealth games ?. i.e. in Sydney, a date of 31 Mar 2006 IS in
DST, but not 31 Mar 2005.

Has anyone else encountered this ?


Brendan Green

Wasn't that hotfix supposed to also be removed (uninstalled) after daylight
savings ended?

Stephen Ahn

Brendan Green said:
Wasn't that hotfix supposed to also be removed (uninstalled) after
daylight savings ended?

Yes, from :

"An automatic update will be released after the end of the 2006 daylight
saving time transition. This update will reset the affected time zones back
to their regular end date. Customers who have Automatic Updates enabled and
who have their computers set to one of the affected time zones do not have
to take any additional action. ".

Maybe that "automatic update" hasn't been released yet ? The PCs here with
auto updates enabled still show +11 hours. Once I manually uninstalled KB
912475 update, the code displays the correct +10 hours. Looks like the patch
was only ever intended as a temporary workaround, which needs to be
uninstalled later. I'd (wrongly) assumed they'd added special code just for
the year 2006 in Australia, but it looks like the end of daylight savings
time algorithm for the affected timezones was changed for ALL years, not
just 2006.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question