Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017 
<== Date ==> <== Thread ==>

Subject: epicsTime_localtime() currently reports daylight saving time incorrectly on Windows
From: <freddie.akeroyd@stfc.ac.uk>
To: <tech-talk@aps.anl.gov>
Date: Mon, 19 Oct 2015 11:10:31 +0000
Hi,

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() )

Regards,

Freddie



Replies:
Re: epicsTime_localtime() currently reports daylight saving time incorrectly on Windows Michael Davidsaver

Navigate by Date:
Prev: Marsh Bellofram Pierrick Hanlet
Next: Re: epicsTime_localtime() currently reports daylight saving time incorrectly on Windows Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017 
Navigate by Thread:
Prev: Marsh Bellofram Pierrick Hanlet
Next: Re: epicsTime_localtime() currently reports daylight saving time incorrectly on Windows Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·