[Issue 1752] std.date.LocalTimetoUTC applies wrong daylight savings time adjustments in EU timezones

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 30 14:28:54 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1752





------- Comment #4 from grahamc001uk at yahoo.co.uk  2007-12-30 16:28 -------
The following further changes to std\date.d (in addition to the above) appear
to
fix the Windows version of LocalTimetoUTC():

Change line #410 from:
        : t - LocalTZA - DaylightSavingTA(t - LocalTZA);
to:
        : t - LocalTZA - DaylightSavingTA(t);


Change line #747 from:
        time = 0;
to:
        time = MakeTime(st.wHour, st.wMinute, 0, 0);


Change line #814 from:
        if (td <= dt && dt <= ts)
to:
        if (td <= dt && dt < ts)



I've only looked at the Windows code. The Linux code appears to be hard coded
for the old U.S. daylight savings adjustments - so that has been incorrect
since
March 11 2007 for the U.S. and has never worked for any EU or for most of the
rest of the world timezones.

The are almost certainly some problems with UTCtoLocalTime() as well (both
Windows and Linux). I've only been checking LocalTimetoUTC().


-- 



More information about the Digitalmars-d-bugs mailing list