Experimental Physics and Industrial Control System
|
Does your application call gettimeofday to get the time stamp?
If so it uses seconds since the UNIX epoc (1970) and microseconds within the
second. Another, less likely, possibility is that your application calls
clock_gettime, which uses seconds since the POSIX epoch (1970) and nanoseconds
within the second. Another possibility is that your application calls time which
just returns seconds since 1970.
For EPICS call tsLocalTime for 3.13 or for 3.14 call epicsTimeGetCurrent.
Marty Kraimer
Kevin Tsubota wrote:
Hi All,
I have a channel access application that we inherited from someone else a
long time ago that is
returning a timestamp of seconds since 1/1/1970. This application also has
its own camonitor
utility that returns the current date. However when I use the base
camonitor I get timestamps 20yrs
in the future.
Upon further investigation I found comments that EPICS uses 1/1/1990 as its
epoch. So I'm guessing
here that EPICS camonitor is taking the timestamp from my application and
adding 20yrs. Is this
correct or am I _way_ out in left field?
Thanks in advance.
Kevin
Code snippet from EPICS R3.13.0Beta12/base/include/tsDefs.h
/*--------------------------------------------------------------------------
-
-
* TS_STAMP
*
* This is the form taken by time stamps in GTACS, and is the form used
* by the various tools used for dealing with time stamps.
*
* The time stamp represents the number of nanoseconds past 0000 Jan 1,
199
0,
* GMT (or UTC, if you prefer).
*
*---------------------------------------------------------------------------
-
*/
typedef struct {
epicsUInt32 secPastEpoch; /* seconds since 0000 Jan 1, 1990 */
epicsUInt32 nsec; /* nanoseconds within second */
} TS_STAMP;
- References:
- timestamp question Kevin Tsubota
- Navigate by Date:
- Prev:
timestamp question Kevin Tsubota
- Next:
RE: timestamp question Jeff Hill
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
<2002>
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
timestamp question Kevin Tsubota
- Next:
RE: timestamp question Jeff Hill
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
<2002>
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|
ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|