BOSS 6.6.4.p01
BESIII Offline Software System
|
#include <Timestamp.h>
Public Member Functions | |
Timestamp () | |
Timestamp (long int seconds, int nano=0, int tzOffset=0) | |
Timestamp (double julian) | |
Constructor for Julian date. Must be GMT. | |
Timestamp (const std::string &str, int tzOffset=0) | |
Timestamp (int year, int month, int day, int hour=0, int minute=0, int second=0, int nano=0) | |
Construct absolute time with specified fields. | |
std::string | getString () const |
Return string representation of time, not including nanoseconds;. | |
double | getJulian () const |
Return julian date. | |
double | getNano () const |
long int | getClibTime () const |
bool | operator< (const Timestamp &other) const |
bool | operator> (const Timestamp &other) const |
bool | operator<= (const Timestamp &other) const |
bool | operator>= (const Timestamp &other) const |
Timestamp & | operator= (const Timestamp &other) |
bool | operator== (const Timestamp &other) const |
bool | operator!= (const Timestamp &other) const |
Protected Attributes | |
time_t | m_time |
internal binary rep of time; count seconds from Jan 1, 1970 | |
int | m_nano |
Save fractional seconds separately (associated with m_time) | |
Timestamp class, valid for dates from 1970 through 2037
Supports comparisons
Input to constructors may be Julian date
seconds since start of 1970, Jan. 1 with optional nanosecond field individual fields (year, month, etc.) string format
yyyy-mm-dd hh:mm:ss 1969 < yyyy < 2038 where 0 < mm < 13 0 < dd < 32 -1 < hh < 24 -1 < mm < 60 -1 < ss < 60
o only the first three fields are required. Omitted trailing fields will be interpreted as equal to 0. o by default : will be used to delimit fields, but user may specify an alternative in most circumstances o leading zeros are optional
Definition at line 49 of file Timestamp.h.
facilities::Timestamp::Timestamp | ( | ) |
Default constructor builds object representing current time, expressed in GMT
Definition at line 19 of file Timestamp.cxx.
facilities::Timestamp::Timestamp | ( | long int | seconds, |
int | nano = 0 , |
||
int | tzOffset = 0 |
||
) |
Count seconds from the creation-according-to-unix, start of 1970 Optional third argument is offset in seconds from GMT (e.g., PST is +28800)
Definition at line 28 of file Timestamp.cxx.
facilities::Timestamp::Timestamp | ( | double | julian | ) |
Constructor for Julian date. Must be GMT.
Definition at line 37 of file Timestamp.cxx.
facilities::Timestamp::Timestamp | ( | const std::string & | str, |
int | tzOffset = 0 |
||
) |
Create a timestamp from an ascii string of standard form yyyy-mm-dd hh:mm:ss where only the first three fields are required.
If the string is invalid, object will represent unix creation time. If the string represents a time in a timezone other than GMT, tzOffset should represent time zone offset relative to GMT in seconds so if local time is, for example, PST, tzOffset should be 28800
Definition at line 53 of file Timestamp.cxx.
facilities::Timestamp::Timestamp | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | second = 0 , |
||
int | nano = 0 |
||
) |
Construct absolute time with specified fields.
Definition at line 59 of file Timestamp.cxx.
|
inline |
Definition at line 88 of file Timestamp.h.
Referenced by Coverage::Coverage(), and SelectInfo::SelectInfo().
double facilities::Timestamp::getJulian | ( | ) | const |
Return julian date.
Definition at line 99 of file Timestamp.cxx.
|
inline |
Definition at line 87 of file Timestamp.h.
std::string facilities::Timestamp::getString | ( | ) | const |
Return string representation of time, not including nanoseconds;.
Definition at line 92 of file Timestamp.cxx.
Referenced by Coverage::checkType(), rdbModel::Column::interpret(), lookup(), main(), operator<<(), calibUtil::Metadata::registerCalib(), and soonest().
Definition at line 118 of file Timestamp.h.
Definition at line 90 of file Timestamp.h.
Definition at line 100 of file Timestamp.h.
Definition at line 95 of file Timestamp.h.
Definition at line 104 of file Timestamp.h.
|
protected |
Save fractional seconds separately (associated with m_time)
Definition at line 156 of file Timestamp.h.
Referenced by getJulian(), getNano(), operator<(), operator=(), operator==(), and Timestamp().
|
protected |
internal binary rep of time; count seconds from Jan 1, 1970
Definition at line 153 of file Timestamp.h.
Referenced by getClibTime(), getJulian(), getString(), operator<(), operator=(), operator==(), and Timestamp().