41 return 86400000000000ll;
48 return 3600000000000ll;
270 ticks_ += other.ticks_;
279 ticks_ -= other.ticks_;
288 std::swap(ticks_, other.ticks_);
390 throw std::invalid_argument(
391 "Unknown timespan format pattern specified. ");
405 toStr(str, timeSpan, format);
510 : sinceEpoch_(other.sinceEpoch_)
603 sinceEpoch_ = other.sinceEpoch_;
816 toStr(str, timestamp, format);
827 return fromStr(ts, str.c_str(), str.size());
832 return toStr(*
this, format);
Milliseconds milliseconds() const
Int32 Milliseconds
Integral type for number of milliseconds.
void swap(TimeSpan &other) noexcept
Exchanges with given instance.
Int32 Minutes
Integral type for number of minutes.
TimeSpan(Ticks ticks=0) noexcept
Initializes timespan from given number of ticks.
Nanoseconds nanoseconds() const
constexpr TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Int32 Nanoseconds
Integral type for number of nanoseconds.
Int32 Seconds
Integral type for number of seconds.
TimeSpan & operator+=(const TimeSpan &other)
Adds time interval to current one.
Microseconds microseconds() const
Int32 Microseconds
Integral type for number of microseconds.
constexpr TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Int32 Hours
Integral type for number of hours.
Int32 Days
Integral type for number of days.
TimeSpan & operator-=(const TimeSpan &other)
Subtracts time interval from current one.
Int64 Ticks
Integral type presenting internal ticks.
Represents time point without time-zone information.
Microsecond microsecond() const
Microsecond component of given time point.
Month month() const
Month component of given time point.
Year year() const
Year component of given time point.
Day day() const
Day component of given time point.
static Timestamp now()
Returns current local time.
UInt32 Hour
Integral type presenting hour component.
Timestamp(Ticks ticks=0) noexcept
Initializes from number of ticks since epoch.
Minute minute() const noexcept
Minute component of given time point.
UInt32 Minute
Integral type presenting minute component.
TimeSpan time() const noexcept
Time part of timestamp.
static Timestamp parse(unsigned long long presentation, TimestampFormat::Enum format=TimestampFormat::YYYYMMDD)
UInt32 Millisecond
Integral type presenting millisecond component.
std::string toString(TimestampFormat::Enum format=TimestampFormat::YYYYMMDDHHMMSSNsec)
Serializes timestamp according to specified pattern.
static Timestamp utcNow()
Returns current UTC time.
UInt64 Ticks
Integral type storing internal ticks.
Timestamp date() const noexcept
Timestamp without a time part.
UInt32 Microsecond
Integral type presenting microsecond component.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
void swap(Timestamp &other)
Exchanges value with other instance.
UInt32 Second
Integral type presenting second component.
UInt32 Day
Integral type presenting day component.
Second second() const noexcept
Second component of given time point.
Timestamp & operator=(const Timestamp &other)
Reinitializes as copy of given instance.
UInt32 Nanosecond
Integral type presenting nanosecond component.
Hour hour() const noexcept
Hour component of given time point.
UInt32 Year
Integral type presenting year component.
Ticks sinceEpoch() const noexcept
Number of nanoseconds since the Epoch (01-01-1970).
Millisecond millisecond() const noexcept
Millisecond component of given time point.
Nanosecond nanosecond() const noexcept
Nanosecond component of given time point.
Timestamp(const Timestamp &other) noexcept
Initializes as copy of other instance.
OnixS::Eurex::MarketData::Month::Enum Month
Type presenting month component.
std::ostream & operator<<(std::ostream &os, const Message &message)
void toStr(std::string &str, TimeSpan timeSpan, TimeSpanFormat::Enum format=TimeSpanFormat::SDHHMMSSnsec)
Appends timespan formatted in specified pattern to given string.
Timestamp fromSeconds(UInt32 secondsSinceEpoch)
Create Timestamp from whole seconds since the Epoch.
bool operator>=(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
bool operator>(const TimeSpan &left, const TimeSpan &right)
Checks whether left time interval greater than right one.
void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSmsec format.
void toStrAsHHMMSSmsec(std::string &, TimeSpan)
bool operator==(const FieldValueRef &ref, const std::string &str)
bool fromStr(Timestamp &, const char *, size_t)
De-serializes a timestamp from the given string.
void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSS format.
void toStrAsHHMMSS(std::string &, TimeSpan)
bool operator<=(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes timestamp in YYYYMMDD format.
void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
bool operator<(const TimeSpan &left, const TimeSpan &right)
Checks whether left time interval less than right one.
Timestamp operator-(const Timestamp ×tamp, const TimeSpan &timeSpan)
Subtracts time interval from given time point.
bool operator!=(const FieldValueRef &ref, const std::string &str)
void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSnsec format.
Identifies months in year.
Miscellaneous time characteristics.
static constexpr Int32 secondsPerMinute()
Returns number of seconds in single minute.
static constexpr Int32 microsecondsPerSecond()
Returns number of microseconds in single second.
static constexpr Int32 millisecondsPerSecond()
Returns number of milliseconds in single second.
static constexpr Int64 nanosecondsPerMinute()
Returns number of nanoseconds in single minute.
static constexpr Int32 hoursPerDay()
Returns number of hours in single day.
static constexpr Int64 nanosecondsPerHour()
Returns number of nanoseconds in single hour.
static constexpr Int32 nanosecondsPerMicrosecond()
Returns number of nanoseconds in single microsecond.
static constexpr Int64 nanosecondsPerDay()
Returns number of nanoseconds in single day.
static constexpr Int32 minutesPerHour()
Returns number of minutes in single hour.
static constexpr Int32 nanosecondsPerSecond()
Returns number of nanoseconds in single second.
static constexpr Int32 nanosecondsPerMillisecond()
Returns number of nanoseconds in single millisecond.