|
EPICS Base
7.0.5.1
|
C++ time stamp object. More...
#include <epicsTime.h>
Classes | |
| class | formatProblemWithStructTM |
Exception: Bad field(s) in struct tm More... | |
| class | unableToFetchCurrentTime |
| Exception: Time provider problem. More... | |
Public Member Functions | |
| epicsTime () | |
| The default constructor sets the time to the EPICS epoch. | |
| size_t | strftime (char *pBuff, size_t bufLength, const char *pFormat) const |
| Convert to string in user-specified format. More... | |
| void | show (unsigned interestLevel) const |
| Dump current state to standard out. | |
epicsTimeStamp conversions | |
Convert to and from EPICS epicsTimeStamp format | |
| operator epicsTimeStamp () const | |
| Convert to epicsTimeStamp. | |
| epicsTime (const epicsTimeStamp &ts) | |
| Construct from epicsTimeStamp. | |
| epicsTime & | operator= (const epicsTimeStamp &) |
| Assign from epicsTimeStamp. | |
ANSI C time_t conversions | |
Convert to and from ANSI C | |
| operator time_t_wrapper () const | |
Convert to ANSI C time_t. | |
| epicsTime (const time_t_wrapper &) | |
Construct from ANSI C time_t. | |
| epicsTime & | operator= (const time_t_wrapper &) |
Assign from ANSI C time_t. | |
ANSI C struct tm local-time conversions | |
Convert to and from ANSI Cs | |
| operator local_tm_nano_sec () const | |
Convert to struct tm in local time zone. | |
| epicsTime (const local_tm_nano_sec &) | |
Construct from struct tm in local time zone. | |
| epicsTime & | operator= (const local_tm_nano_sec &) |
Assign from struct tm in local time zone. | |
ANSI C struct tm UTC conversions | |
Convert to and from ANSI Cs | |
| operator gm_tm_nano_sec () const | |
Convert to struct tm in UTC/GMT. | |
| epicsTime (const gm_tm_nano_sec &) | |
Construct from struct tm in UTC/GMT. | |
| epicsTime & | operator= (const gm_tm_nano_sec &) |
Assign from struct tm in UTC. | |
POSIX RT struct timespec conversions | |
Convert to and from the POSIX RealTime | |
| operator struct timespec () const | |
Convert to struct timespec | |
| epicsTime (const struct timespec &) | |
Construct from struct timespec | |
| epicsTime & | operator= (const struct timespec &) |
Assign from struct timespec | |
BSD's struct timeval conversions | |
Convert to and from the BSD | |
| operator struct timeval () const | |
Convert to struct timeval | |
| epicsTime (const struct timeval &) | |
Construct from struct timeval | |
| epicsTime & | operator= (const struct timeval &) |
Assign from struct timeval | |
NTP timestamp conversions | |
Convert to and from the NTP timestamp structure | |
| operator l_fp () const | |
| Convert to NTP format. | |
| epicsTime (const l_fp &) | |
| Construct from NTP format. | |
| epicsTime & | operator= (const l_fp &) |
| Assign from NTP format. | |
WIN32 FILETIME conversions | |
Convert to and from WIN32s
| |
| operator struct _FILETIME () const | |
Convert to Windows struct _FILETIME | |
| epicsTime (const struct _FILETIME &) | |
Constuct from Windows struct _FILETIME | |
| epicsTime & | operator= (const struct _FILETIME &) |
Assign from Windows struct _FILETIME | |
Arithmetic operators | |
Standard operators involving epicsTime objects and time differences which are always expressed as a | |
| double | operator- (const epicsTime &) const |
lhs minus rhs, in seconds | |
| epicsTime | operator+ (const double &) const |
lhs plus rhs seconds | |
| epicsTime | operator- (const double &) const |
lhs minus rhs seconds | |
| epicsTime | operator+= (const double &) |
add rhs seconds to lhs | |
| epicsTime | operator-= (const double &) |
subtract rhs seconds from lhs | |
Comparison operators | |
Standard comparisons between epicsTime objects. | |
| bool | operator== (const epicsTime &) const |
lhs equals rhs | |
| bool | operator!= (const epicsTime &) const |
lhs not equal to rhs | |
| bool | operator<= (const epicsTime &) const |
rhs no later than lhs | |
| bool | operator< (const epicsTime &) const |
lhs was before rhs | |
| bool | operator>= (const epicsTime &) const |
rhs not before lhs | |
| bool | operator> (const epicsTime &) const |
lhs was after rhs | |
Static Public Member Functions | |
| static epicsTime | getEvent (const epicsTimeEvent &) |
| Get time of event system event. More... | |
| static epicsTime | getCurrent () |
| Get current clock time. More... | |
| static epicsTime | getMonotonic () |
| Get current monotonic time. More... | |
Holds an EPICS time stamp, and provides conversion functions for both input and output from/to other types.
Definition at line 132 of file epicsTime.h.
|
static |
Returns an epicsTime indicating when the associated event system event last occurred.
|
static |
Returns an epicsTime containing the current time. For example:
|
static |
Returns an epicsTime containing the current monotonic time, an OS clock which never going backwards or jumping forwards. This time is has an undefined epoch, and is only useful for measuring time differences.
| size_t epicsTime::strftime | ( | char * | pBuff, |
| size_t | bufLength, | ||
| const char * | pFormat | ||
| ) | const |
This method extends the standard C library routine strftime(). See your OS documentation for details about the standard routine. The epicsTime method adds support for printing the fractional portion of the time. It searches the format string for the sequence %0nf where n is the desired precision, and uses this format to convert the fractional seconds with the requested precision. For example:
This will print the current time in the format:
1.8.13