epicsTime_localtime() currently reports daylight saving time incorrectly on Windows

Bug #1528284 reported by mdavidsaver on 2015-12-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Low
mdavidsaver
3.14
Undecided
Unassigned
3.15
Undecided
Unassigned
3.16
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) on 2016-04-20
Changed in epics-base:
status: In Progress → Fix Committed
Andrew Johnson (anj) on 2016-05-31
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  Edit
Everyone can see this information.

Other bug subscribers