epicsTime_localtime() currently reports daylight saving time incorrectly on Windows

Bug #1528284 reported by mdavidsaver
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Low
mdavidsaver
3.14
Fix Released
Undecided
Unassigned
3.15
Fix Released
Undecided
Unassigned
3.16
Fix Released
Low
mdavidsaver

Bug Description

Freddie Akeroyd reports:

I've noticed that the "tm_isdst" member of the "struct tm" returned by the Win32 implementation of epicsTime_localtime() is not currently reporting DST status correctly. The problem is that though the StandardDate / DaylightDate members of TIME_ZONE_INFORMATION are SYSTEMTIME structures, they have slightly different interpretations of their contents than usual in particular wDay == 5 means "last occurrence of wDayOfWeek in the month" rather than "5th day of month". One solution would be to use the status returned by GetTimeZoneInformation() which now seems to include the DST status, but I think the epicsTime_localtime() implementation could actually be replace by something simpler like (give or take a NULL pointer check):

     memcpy(pTM, localtime(pAnsiTime), sizeof(struct tm));

as on WIN32 the localtime() function uses thread local storage rather than global static storage (though the same TLS is shared with gmtime() )

http://www.aps.anl.gov/epics/tech-talk/2015/msg01646.php

Related branches

Changed in epics-base:
status: Confirmed → In Progress
Andrew Johnson (anj)
Changed in epics-base:
status: In Progress → Fix Committed
Andrew Johnson (anj)
Changed in epics-base:
milestone: 3.14.branch → 3.14.12.6
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.