www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5141] New: DaylightSavingTA() is returning incorrect data

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5141

           Summary: DaylightSavingTA() is returning incorrect data
           Product: D
           Version: D1
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: koine4895 mypacks.net



DaylightSavingTA() is using the Windows API GetTimeZoneInformation() call, and
is assuming that the StandardDate and DaylightDate members of the
TIME_ZONE_INFORMATION structure are normal SYSTEMTIME values, but they are not.
From date.d:
              ts = SYSTEMTIME2d_time(&tzi.StandardDate, dt);
              td = SYSTEMTIME2d_time(&tzi.DaylightDate, dt);

              if (td <= dt && dt < ts)
              {
                  t = -tzi.DaylightBias * (60 * TicksPerSecond);
                  //printf("DST is in effect, %d\n", t);
              }
From MSDN:
DaylightDate
Specifies a SYSTEMTIME structure that contains a date and local time when the
transition from standard time to daylight saving time occurs on this operating
system. If this date is not specified, the wMonth member in the SYSTEMTIME
structure must be zero. If this date is specified, the StandardDate value in
the TIME_ZONE_INFORMATION structure must also be specified.
To select the correct day in the month, set the wYear member to zero, the
wDayOfWeek member to an appropriate weekday, and the wDay member to a value in
the range 1 through 5. Using this notation, the first Sunday in April can be
specified, as can the last Thursday in October (5 is equal to "the last").

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 31 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5141


Robert <koine4895 mypacks.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



Sorry .. noticed that it was checking for wYear 0 in SYSTEMTIME2d_time() ..
back to the drawing board to figure out why I'm getting the wrong hour ...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 31 2010