OnixS ICE iMpact Multicast Price Feed Handler C++ library 8.18.0
API documentation
Loading...
Searching...
No Matches
Timestamp Class Reference

Public Member Functions

 Timestamp ()
 Timestamp (unsigned year, Month month, unsigned day)
 Timestamp (unsigned year, Month month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned nanosecond)
 Timestamp (const Timestamp &other)
 Timestamp (const TimeSpan &)
unsigned int year () const
Month month () const
unsigned int day () const
unsigned int hour () const
unsigned int minute () const
unsigned int second () const
unsigned int millisecond () const
unsigned int microsecond () const
unsigned int nanosecond () const
Timestamp date () const
void date (Date &) const
TimeSpan time () const
DayOfWeek dayOfWeek () 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
Timestampoperator+= (const TimeSpan &span)
Timestampoperator-= (const TimeSpan &span)
Timestampoperator= (const Timestamp &other)
std::string toString (TimestampFormat format=TimestampFormats::YYYYMMDDHHMMSSnsec) const
void toString (std::string &str, TimestampFormat format=TimestampFormats::YYYYMMDDHHMMSSnsec) const

Static Public Member Functions

static Timestamp now ()
static Timestamp utcNow ()
static Timestamp deserialize (const std::string &)
static Timestamp deserialize (unsigned long long presentation, TimestampFormat format)

Friends

TimeSpan operator- (const Timestamp &left, const Timestamp &right)

Detailed Description

Definition at line 416 of file Time.h.

Constructor & Destructor Documentation

◆ Timestamp() [1/5]

Timestamp ( )

Initializes as Jan 1, 0001, 00:00:00.

◆ Timestamp() [2/5]

Timestamp ( unsigned year,
Month month,
unsigned day )

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() [3/5]

Timestamp ( unsigned year,
Month month,
unsigned day,
unsigned hour,
unsigned minute,
unsigned second,
unsigned nanosecond )

Explicit timestamp initialization.

Input parameters are validated, therefore constructor throws exception if input values do not fit into their valid ranges.

◆ Timestamp() [4/5]

Timestamp ( const Timestamp & other)

Initializes as copy of other instance.

◆ Timestamp() [5/5]

Timestamp ( const TimeSpan & )

Initializes from time interval since the Epoch.

Member Function Documentation

◆ date() [1/2]

Timestamp date ( ) const

Returns timestamp without time part.

◆ date() [2/2]

void date ( Date & ) const

Returns date component of timestamp.

◆ day()

unsigned int day ( ) const

Day component of timestamp.

◆ dayOfWeek()

DayOfWeek dayOfWeek ( ) const

Returns day of the week.

◆ deserialize() [1/2]

Timestamp deserialize ( const std::string & )
static

De-serializes timestamp from text presentation.

◆ deserialize() [2/2]

Timestamp deserialize ( unsigned long long presentation,
TimestampFormat format )
static

De-serializes timestamp from its numeric presentation as it's used by the ICE.

◆ hour()

unsigned int hour ( ) const
inline

Hour component of timestamp.

Definition at line 541 of file Time.h.

◆ microsecond()

unsigned int microsecond ( ) const
inline

Microsecond component of timestamp.

Definition at line 561 of file Time.h.

◆ millisecond()

unsigned int millisecond ( ) const
inline

Millisecond component of timestamp.

Definition at line 556 of file Time.h.

◆ minute()

unsigned int minute ( ) const
inline

Minute component of timestamp.

Definition at line 546 of file Time.h.

◆ month()

Month month ( ) const

Month component of timestamp.

◆ nanosecond()

unsigned int nanosecond ( ) const
inline

Nanosecond component of timestamp.

Definition at line 566 of file Time.h.

◆ now()

Timestamp now ( )
static

Return timestamp that is current date and time expressed as local time.

◆ operator!=()

bool operator!= ( const Timestamp & other) const

Compares with other instance for inequality.

◆ operator+=()

Timestamp & operator+= ( const TimeSpan & span)

Adds time interval to given timestamp.

◆ operator-=()

Timestamp & operator-= ( const TimeSpan & span)

Subtracts time interval from given timestamp.

◆ operator<()

bool operator< ( const Timestamp & other) const

Checks whether timestamp is less than other one.

◆ operator=()

Timestamp & operator= ( const Timestamp & other)

Re-initializes as copy of other timestamp.

◆ operator==()

bool operator== ( const Timestamp & other) const

Compares with other instance for equality.

◆ operator>()

bool operator> ( const Timestamp & other) const

Checks whether timestamp is greater than other one.

◆ second()

unsigned int second ( ) const
inline

Second component of timestamp.

Definition at line 551 of file Time.h.

◆ time()

TimeSpan time ( ) const

Return time part of timestamp.

◆ toString() [1/2]

void toString ( std::string & str,
TimestampFormat format = TimestampFormats::YYYYMMDDHHMMSSnsec ) const

Returns text presentation of timestamp using specified presentation format.

◆ toString() [2/2]

std::string toString ( TimestampFormat format = TimestampFormats::YYYYMMDDHHMMSSnsec) const
inline

Returns text presentation of timestamp using specified presentation format.

Definition at line 571 of file Time.h.

◆ utcNow()

Timestamp utcNow ( )
static

Return timestamp that is current date and time expressed as UTC time.

◆ year()

unsigned int year ( ) const

Year component of timestamp.

◆ operator-

TimeSpan operator- ( const Timestamp & left,
const Timestamp & right )
friend

Calculates time interval between two timestamps.