Static Public Member Functions | |
static Timestamp | now () |
static void | now (Timestamp &) |
static Timestamp | utcNow () |
static void | utcNow (Timestamp &) |
static Timestamp | deserialize (const StringRef &) |
static Timestamp | fromUnixTimestamp (UInt64 sinceEpoch, SinceEpochUnit unit) |
static Timestamp | maxTimestamp () |
Friends | |
TimeSpan | operator- (const Timestamp &left, const Timestamp &right) |
Timestamp | ( | ) |
Initializes as Jan 1, 1970, 00:00:00.
Initializes as date with zero time component.
Input parameters are validated, therefore constructor throws exception if input values do not fit into their valid ranges.
Timestamp | ( | UInt32 | year, |
Month | month, | ||
UInt32 | day, | ||
UInt32 | hour, | ||
UInt32 | minute, | ||
UInt32 | second, | ||
UInt32 | nanosecond ) |
Explicit timestamp initialization.
Input parameters are validated, therefore constructor throws exception if input values do not fit into their valid ranges.
Timestamp date | ( | ) | const |
Returns timestamp without time part.
UInt32 day | ( | ) | const |
Day component of timestamp.
DayOfWeek dayOfWeek | ( | ) | const |
Returns day of the week.
|
static |
Converts timestamp from its numeric presentation (Unix timestamp in nanoseconds or days since 01-01-1970 UTC) as it's used by the CME Globex.
UInt32 hour | ( | ) | const |
Hour component of timestamp.
|
static |
Returns the maximal possible timestamp (year 2554)
UInt32 microsecond | ( | ) | const |
Microsecond component of timestamp.
UInt32 millisecond | ( | ) | const |
Millisecond component of timestamp.
UInt32 minute | ( | ) | const |
Minute component of timestamp.
UInt32 nanosecond | ( | ) | const |
Nanosecond component of timestamp.
|
static |
Return timestamp that is current date and time expressed as local time.
|
static |
Return timestamp that is current date and time expressed as local time.
bool operator!= | ( | const Timestamp & | other | ) | const |
Compares with other instance for inequality.
bool operator< | ( | const Timestamp & | other | ) | const |
Checks whether timestamp is less than other one.
bool operator== | ( | const Timestamp & | other | ) | const |
Compares with other instance for equality.
bool operator> | ( | const Timestamp & | other | ) | const |
Checks whether timestamp is greater than other one.
UInt32 second | ( | ) | const |
Second component of timestamp.
TimeSpan time | ( | ) | const |
Return time part of timestamp.
void toString | ( | std::string & | str, |
TimestampFormat | format = TimestampFormats::YYYYMMDDHHMMSSnsec ) const |
Returns text presentation of timestamp using specified presentation format.
|
inline |
UInt64 toUnixTimestamp | ( | SinceEpochUnit | unit | ) | const |
Converts timestamp into its numeric presentation (Unix timestamp in nanoseconds or days since 01-01-1970 UTC) as it's used by the CME Globex.
|
static |
Return timestamp that is current date and time expressed as UTC time.
|
static |
Return timestamp that is current date and time expressed as UTC time.
UInt32 year | ( | ) | const |
Year component of timestamp.