#include "CTBtime.hxx"
Public Methods | |
CTBtime () | |
CTBtime (double d_time) | |
void | GetSystemTime () |
void | Split (CTBint32 &i_sec, CTBint32 &i_usec) const |
bool | Valid () const |
CTBint32 | UnixTime () const |
void | ToStream (ostream &os) const |
void | FromStream (istream &is) |
bool | operator! () const |
CTBtime & | operator= (double d_time) |
CTBtime & | operator+= (double d_delta) |
CTBtime & | operator-= (double d_delta) |
operator double () const | |
Static Public Methods | |
CTBint32 | ymdhms2ui (int i_year, int i_month, int i_day, int i_hour, int i_min, int i_sec) |
CTBint32 | vms2ui (const char *c_time) |
void | ui2local (char *c_time, int i_size, const char *c_format, CTBint32 i_time) |
void | ui2utc (char *c_time, int i_size, const char *c_format, CTBint32 i_time) |
void | ui2vms (char c_time[21], CTBint32 i_time) |
Private Attributes | |
double | md_time |
Friends | |
CTBtime | operator+ (const CTBtime &time, double d_delta) |
CTBtime | operator+ (double d_delta, const CTBtime &time) |
CTBtime | operator- (const CTBtime &time, double d_delta) |
double | operator- (const CTBtime &lhs, const CTBtime &rhs) |
bool | operator== (const CTBtime &lhs, const CTBtime &rhs) |
bool | operator< (const CTBtime &lhs, const CTBtime &rhs) |
Related Functions | |
(Note that these are not member functions.) | |
ostream & | operator<< (ostream &os, const CTBtime &obj) |
istream & | operator>> (istream &is, CTBtime &obj) |
The class CTBtime
represents `calendar time'. The internal representation is accurate to a microsecond and allows to do time arithmetic in an efficient fashion. A CTBtime
can be converted into a double
holding an `absolute time' in the form of the number of seconds elapsed since the UNIX epoch, 00:00:00 on January 1, 1970, UTC.
Definition at line 16 of file CTBtime.hxx.
|
Default constructor, sets time to invalid.
Definition at line 19 of file CTBtime.icc. |
|
Construct from absolute time.
Definition at line 26 of file CTBtime.icc. |
|
Get system time.
Definition at line 44 of file CTBtime.cxx. |
|
Split time in second since epoch and fractional second parts.
Definition at line 60 of file CTBtime.cxx. Referenced by CTBtimeParsed::ParseTime().
|
|
Returns
Definition at line 33 of file CTBtime.icc. Referenced by CTBtimeParsed::ParseTime(), CTBxmlOStream::PutTaggedValue(), Split(), and operator!().
|
|
Returns time as integer number of seconds since the Unix epoch.
Definition at line 41 of file CTBtime.icc. |
|
ostream insertion, uses
Definition at line 84 of file CTBtime.cxx. Referenced by operator<<().
|
|
istream extraction, uses
Definition at line 94 of file CTBtime.cxx. Referenced by operator>>().
|
|
Returns
Definition at line 49 of file CTBtime.icc. |
|
Set to absolute time.
Definition at line 57 of file CTBtime.icc. |
|
Add delta time.
Definition at line 66 of file CTBtime.icc. |
|
Subtract delta time.
Definition at line 75 of file CTBtime.icc. |
|
Convert to absolute time.
Definition at line 84 of file CTBtime.icc. |
|
Convert from ymdhms to unix int. Converts a time specified with i_year, ..., i_sec to a UNIX int time. The arguments have the meaning:
Definition at line 117 of file CTBtime.cxx. Referenced by vms2ui().
|
|
Convert VMS time string to UNIX int time.
Definition at line 151 of file CTBtime.cxx. |
|
Convert int to local time string. The time i_time, given as UNIX int time, is converted using the format c_format into a character string stored in c_time with a maximal length of i_size. The format c_format is in strftime format. Definition at line 228 of file CTBtime.cxx. Referenced by ui2vms().
|
|
Convert int to UTC time string. The time i_time, given as UNIX int time, is converted using the format c_format into a character string stored in c_time with a maximal length of i_size. The format c_format is in strftime format. Definition at line 247 of file CTBtime.cxx. |
|
Convert int to VMS time string. The time i_time, given as UNIX int time, is converted into a character string in VMS time format "dd-mmm-yyyy hh:mm:ss" and stored in c_time. Definition at line 265 of file CTBtime.cxx. |
|
Add a delta time d_delta to a time.
Definition at line 95 of file CTBtime.icc. |
|
Add a delta time d_delta to a time.
Definition at line 106 of file CTBtime.icc. |
|
Subtract a delta time d_delta from a calendar time.
Definition at line 117 of file CTBtime.icc. |
|
Subtract two calendar times, resulting in a delta time in seconds.
Definition at line 128 of file CTBtime.icc. |
|
Returns
Definition at line 139 of file CTBtime.icc. |
|
Returns
Definition at line 150 of file CTBtime.icc. |
|
ostream insertion operator, forwards to
Definition at line 161 of file CTBtime.icc. |
|
istream extraction operator, forwards to
Definition at line 173 of file CTBtime.icc. |
|
time in sec since epoch.
Definition at line 61 of file CTBtime.hxx. |