EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Problems within epicsTime.cpp
From: "Denison, PN (Peter)" <[email protected]>
To: "Andrew Johnson" <[email protected]>, "Kay-Uwe Kasemir" <[email protected]>
Cc: [email protected]
Date: Thu, 31 Jan 2008 16:25:11 -0000
> From: Andrew Johnson [mailto:[email protected]] 
> Sent: 31 January 2008 14:44
> 
>  > On Jan 31, 2008, at 05:22 , Denison, PN (Peter) asked:
>  >>
>  >> Can I replace this code in epicsTimeLoadTimeInit with a constant?
> 
> Kay-Uwe Kasemir wrote:
> > 
> > Yes, make it a constant.
> 
> No, don't.  Apply the attached patch instead, which is a diff between 
> R3.14.9 and the current head of the R3.14 branch and should 
> work in all timezones.
> 
> The Posix spec apparently does not require that a time_t be 
> expressed in seconds, although Unix historically has used that.
> The existing (broken) code does not make that assumption, and
> neither does my patched version (which I did tell Peter about
> several months ago), but a using constant probably does.

I did look at CVS HEAD and this patch before I sent my e-mail.
Unfortunately the patch won't work, ONLY IN THE UK, with the strictly
valid "Europe/London" timezone, because the DST offsets don't cancel
out. This is because on 1/1/1970, the UK was on permanent daylight
savings time, and on 1/1/1990 it was not.

The problem is that mktime converts a local time, and we want the
distance between 2 epochs referenced from UTC.

Can I do it by leaving the existing code intact, but setting TZ to UTC,
calling tzset() and then restoring the previous state of TZ?

-- 
Peter Denison, Senior Software Engineer, Diamond Light Source Ltd.
Tel: +44 1235 778511
(apologies in advance for the lines below. Some bits are a legal
requirement and I have no control over them)


Replies:
Re: Problems within epicsTime.cpp Andrew Johnson
References:
Re: Problems within epicsTime.cpp Andrew Johnson

Navigate by Date:
Prev: Re: Problems within epicsTime.cpp Andrew Johnson
Next: Re: Problems within epicsTime.cpp Kay-Uwe Kasemir
Index: 2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Problems within epicsTime.cpp Kay-Uwe Kasemir
Next: Re: Problems within epicsTime.cpp Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·