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  <20132014  2015  2016  2017  2018  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018 
<== Date ==> <== Thread ==>

Subject: RE: EPICS UTC Time conversion
From: "Kim, Kukhee" <khkim@slac.stanford.edu>
To: Eric Norum <wenorum@lbl.gov>, "Allison, Stephanie" <saa@slac.stanford.edu>, "tech-talk@aps.anl.gov Talk" <tech-talk@aps.anl.gov>
Date: Tue, 16 Apr 2013 15:18:23 -0700
Hi Eric;

I am not sure, but it looks related with DST.

Thank you.
Best regards,
Kukhee
--------------------------------------------
Kukhee Kim
SLAC National Accelerator Laboratory
2575 Sand Hill Rd, MS 64
Menlo Park, CA 94025
Email: khkim@SLAC.Stanford.EDU
Phone: (650)926-4912


-----Original Message-----
From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Eric Norum
Sent: Tuesday, April 16, 2013 3:03 PM
To: Allison, Stephanie; tech-talk@aps.anl.gov Talk
Subject: Re: EPICS UTC Time conversion

Good idea, but doesn't seem to help:

    timestamp.secPastEpoch = 1366124582 - POSIX_TIME_AT_EPICS_EPOCH;
    timestamp.nsec = 0;
    epicsTimeToGMTM(&tm, &nsec, &timestamp);
    tm.tm_isdst = 0;
    epicsTimeFromTM(&utc, &tm, 0);
    epicsTimeToStrftime(cbuf, sizeof cbuf, "%F_%H:%M:%S", &utc);
    printf("%s\n", cbuf);
produces
    2013-04-16_16:03:02

But

	date -u -r 1366124582
	Tue Apr 16 15:03:02 UTC 2013




On Apr 16, 2013, at 2:54 PM, "Allison, Stephanie" <saa@slac.stanford.edu> wrote:


	Hi Eric,
	
	Perhaps force the isdst flag to 0 in between calls:
	
	

		epicsTimeToGMTM(&tm, &nsec, &timestamp);
		

	tm.tm_isdst = 0;
	

		epicsTimeFromTM(&utc, &tm, 0);
		





References:
EPICS UTC Time conversion Eric Norum
RE: EPICS UTC Time conversion Allison, Stephanie
Re: EPICS UTC Time conversion Eric Norum

Navigate by Date:
Prev: RE: autosave limitation? Emmanuel Mayssat
Next: Re: EPICS UTC Time conversion Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018 
Navigate by Thread:
Prev: Re: EPICS UTC Time conversion Eric Norum
Next: Re: EPICS UTC Time conversion Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·