EPICS Controls 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  2019  2020  2021  2022  2023  2024  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  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS UTC Time conversion
From: Eric Norum <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: "[email protected] Talk" <[email protected]>
Date: Tue, 16 Apr 2013 16:45:45 -0700
Thanks -- that works great.

On Apr 16, 2013, at 4:10 PM, Andrew Johnson <[email protected]> wrote:

> Hi Eric,
> 
> On 2013-04-16 Eric Norum wrote:
>> date -u -r 1366124582
>> Tue Apr 16 15:03:02 UTC 2013
> 
> This seems to work and is shorter and probably faster:
> 
> #include <stdio.h>
> #include "epicsTime.h"
> 
> int main() {
>    epicsTimeStamp timestamp;
>    struct tm tm;
>    unsigned long nsec;
> 
>    timestamp.secPastEpoch = 1366124582 - POSIX_TIME_AT_EPICS_EPOCH;
>    timestamp.nsec = 0;
>    epicsTimeToGMTM(&tm, &nsec, &timestamp);
>    printf("%04d-%02d-%02d_%02d:%02d:%02d\n", tm.tm_year + 1900,
>        tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
>    return 0;
> }
> 
> 2103-03-16_15:03:02
> 
> - Andrew
> -- 
> It is difficult to get a man to understand something, when his salary
> depends upon his not understanding it. -- Upton Sinclair


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

Navigate by Date:
Prev: Re: EPICS UTC Time conversion Till Straumann
Next: Re: autosave limitation? Tim Mooney
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  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: EPICS UTC Time conversion Andrew Johnson
Next: Re: EPICS UTC Time conversion Till Straumann
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  2019  2020  2021  2022  2023  2024 
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 ·