J
John Roberts
Another summer begins and yet again, my code for handling daylight saving
time didn't work. I only get twice a year to test this in the field!
Anyway,...
Is DST broken in Compact Framework v2.0?
I have TimeZoneInformation set correctly in the registry:
[HKEY_LOCAL_MACHINE\Time]
"TimeZoneInformation"=hex:\
00,00,00,00,47,00,4d,00,54,00,20,00,53,00,74,00,61,00,6e,00,64,00,61,00,72,\
00,64,00,20,00,54,00,69,00,6d,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,05,\
00,02,00,00,00,00,00,00,00,00,00,00,00,47,00,4d,00,54,00,20,00,44,00,61,00,\
79,00,6c,00,69,00,67,00,68,00,74,00,20,00,54,00,69,00,6d,00,65,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,03,00,00,00,05,00,01,00,00,00,00,00,00,00,c4,ff,ff,ff
It is set for GMT Standard Time/Daylight Time. However,
i) TimeZone.CurrentTimeZone returns 'false' for IsDaylightTime(DateTime.Now)
ii) TimeZone.CurrentTimeZone.GetDaylightChanges(2006) returns an invalid
date
iii) TimeZone.CurrentTimeZone.DaylightName is 'GMT Standard Time' - it
should be 'GMT Daylight Time'
iv) DateTime.Now returns GMT, not BST
It is as though CF is ignoring the time zone setting in the registry...
I get the same results regardless of what SetDaylightTime() has been set to,
although in general I don't use this 'feature' of Windows CE and keep it
off. BTW, the platform is Windows CE v5.0...
Everything worked last summer when I was using Compact Framework v1.0. I
can't think what else might be wrong other than a problem with CF v2.0...
does anybody have it working correctly?
TIA,
- John
time didn't work. I only get twice a year to test this in the field!
Anyway,...
Is DST broken in Compact Framework v2.0?
I have TimeZoneInformation set correctly in the registry:
[HKEY_LOCAL_MACHINE\Time]
"TimeZoneInformation"=hex:\
00,00,00,00,47,00,4d,00,54,00,20,00,53,00,74,00,61,00,6e,00,64,00,61,00,72,\
00,64,00,20,00,54,00,69,00,6d,00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,05,\
00,02,00,00,00,00,00,00,00,00,00,00,00,47,00,4d,00,54,00,20,00,44,00,61,00,\
79,00,6c,00,69,00,67,00,68,00,74,00,20,00,54,00,69,00,6d,00,65,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,03,00,00,00,05,00,01,00,00,00,00,00,00,00,c4,ff,ff,ff
It is set for GMT Standard Time/Daylight Time. However,
i) TimeZone.CurrentTimeZone returns 'false' for IsDaylightTime(DateTime.Now)
ii) TimeZone.CurrentTimeZone.GetDaylightChanges(2006) returns an invalid
date
iii) TimeZone.CurrentTimeZone.DaylightName is 'GMT Standard Time' - it
should be 'GMT Daylight Time'
iv) DateTime.Now returns GMT, not BST
It is as though CF is ignoring the time zone setting in the registry...
I get the same results regardless of what SetDaylightTime() has been set to,
although in general I don't use this 'feature' of Windows CE and keep it
off. BTW, the platform is Windows CE v5.0...
Everything worked last summer when I was using Compact Framework v1.0. I
can't think what else might be wrong other than a problem with CF v2.0...
does anybody have it working correctly?
TIA,
- John