If you're on an Windows XP or Vista box and live in the U.S...

Jonathan M Davis jmdavisProg at gmx.com
Thu Mar 24 15:02:05 PDT 2011


> I have no idea which 3 of the 4 continental US time zones you consider the
> "primary" ones, but I'm in Cleveland, which is the Eastern time zone (and
> the same as New York). I have no idea if it's currently daylight savings
> time or not - I can never remember which is which (But I do know we
> recently pushed the clocks ahead an hour, so whatever that means).
> 
> XP Pro SP2 32-bit:
> 
> 1999-Mar-01 00:00:00
> 1999-Mar-08 00:00:00
> 1999-Mar-14 00:00:00
> 1999-Mar-14 01:00:00
> 1999-Mar-14 01:00:00
> 1999-Mar-14 03:00:00
> 1999-Mar-15 00:00:00
> 1999-Mar-22 00:00:00
> 1999-Mar-29 00:00:00
> 1999-Apr-01 00:00:00
> 1999-Apr-03 00:00:00
> 1999-Apr-04 01:00:00
> 1999-Apr-04 02:00:00
> 1999-Apr-04 03:00:00
> 1999-Apr-05 00:00:00

LOL. There _are_ 4 main time zones, aren't there. A 3 hour difference means 4 
different time zones, not 3. Ouch. I obviously didn't think that one through 
enough. Regardless, I need the code to be run in a time zone which was 
affected by the 2007 DST rule changes that were made in the U.S. I _know_ that 
the Pacific, Mountain, Central, and Eastern time zones were affected by the 
DST rule changes in 2007. There are obviously some areas in the continental 
U.S. which weren't (such as Arizona), but the those four main ones were. The 
time zones for Alaska and Hawaii were probably affected as well, but I don't 
know for sure. Also, I _think_ that Canada also changed their DST rules, but 
I'm not sure. I know that Mexico didn't. Regardless, I need the code run in a 
time zone which was affected by the DST rule changes that the U.S. made in 
2007.

Given that the other posts list XP with having 23:00 on the day before rather 
than at 00:00 for the dates in the middle, it looks like XP has the same 
behavior as XP. However, it looks like whatever time zone you have your 
computer in (if it's really the same as New York, it would Eastern Daylight 
Time at the moment) is not actually EST/EDT proper (either that or the two 
other posts with XP are on SP3 while you're on SP2 and changes were made in 
SP3 which affect the Windows functions being called). Glancing at the list of 
Windows time zones though, I don't see any cities which would currently would 
be in normal Eastern time but would have been in a slightly different time 
zone (e.g. no DST) prior to 2007. I _thought_ that some of Indiana was that 
way, but if so, they didn't get a special time zone for it in Windows.

If Windows were really using the TIME_ZONE_INFORMATION struct that it's given, 
then I would expect the behavior that you're showing. If it's trying to 
determine the real DST rules and ignore the struct it's given, then I would 
expect the behavior that I'm seeing on my Windows 7 box and what Walter and 
Bekenn posted. So, my guess is that SP3 changed how the time zone stuff was 
handled.

- Jonathan M Davis


More information about the Digitalmars-d mailing list