37 return 86400000000000ll;
44 return 3600000000000ll;
191 numericCast<Ticks>(
days) *
193 numericCast<Ticks>(
hours) *
212 numericCast<Ticks>(
hours) *
250 numericCast<Minutes>(
263 numericCast<Seconds>(
276 numericCast<Milliseconds>
289 numericCast<Microseconds>
302 numericCast<Nanoseconds>
319 ticks_ += other.ticks_;
327 ticks_ -= other.ticks_;
335 std::swap(ticks_, other.ticks_);
351 return left.ticks() == right.ticks();
358 return left.ticks() != right.ticks();
365 return left.ticks() < right.ticks();
372 return left.ticks() > right.ticks();
416 toStr(str, timeSpan, format);
532 : sinceEpoch_(other.sinceEpoch_)
569 return static_cast<Hour>(
time().hours());
629 sinceEpoch_ = other.sinceEpoch_;
637 std::swap(sinceEpoch_, other.sinceEpoch_);
651 static Ticks toTicks(Year,
Month, Day, Hour, Minute, Second, Nanosecond);
655 static void toDate(Ticks, Year&,
Month&, Day&);
731 timestamp.sinceEpoch() +
742 timestamp.sinceEpoch() -
751 return TimeSpan(left.sinceEpoch() - right.sinceEpoch());
789 toStr(str, timestamp, format);
798inline std::ostream & operator <<(std::ostream & os,
const Timestamp& value)
800 return os <<
toStr(value);
804std::ostream & operator <<(std::ostream & os,
const TimeSpan& value)
806 return os <<
toStr(value);
820 ts, str.c_str(), str.size());
834 ts, str.c_str(), str.size(), format);
846 throw std::runtime_error(
"Error parsing timestamp.");
860 throw std::runtime_error(
"Error parsing timespan.");
868 return toStr(*
this, format);
874 return toStr(*
this, format);
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
#define ONIXS_ILINK3_LTWT_STRUCT
#define ONIXS_ILINK3_LTWT_CLASS
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_ILINK3_LTWT_EXPORTED
#define ONIXS_ILINK3_NODISCARD
#define ONIXS_ILINK3_EXPORTED
#define ONIXS_ILINK3_CONSTEXPR
#define ONIXS_ILINK3_PURE
#define ONIXS_ILINK3_NOTHROW
Nanoseconds nanoseconds() const noexcept
Int32 Milliseconds
Integral type for number of milliseconds.
static TimeSpan fromStr(const std::string &)
De-serializes the timespan from the given string according to the specified pattern.
void swap(TimeSpan &other) noexcept
Swaps.
Int32 Minutes
Integral type for number of minutes.
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Initializes with the given set of values.
TimeSpan(Ticks ticks=0) noexcept
Initializes the timespan from the given number of ticks.
TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Initializes with the given set of values.
Int32 Nanoseconds
Integral type for number of nanoseconds.
Int32 Seconds
Integral type for number of seconds.
Microseconds microseconds() const noexcept
Ticks ticks() const noexcept
Hours hours() const noexcept
Int32 Microseconds
Integral type for number of microseconds.
TimeSpan & operator-=(const TimeSpan &other) noexcept
Subtracts the given time interval.
std::string toString(TimeSpanFormat::Enum=TimeSpanFormat::SDHHMMSSnsec) const
Int32 Hours
Integral type for number of hours.
TimeSpan & operator+=(const TimeSpan &other) noexcept
Adds the given time interval.
Int32 Days
Integral type for number of days.
Days days() const noexcept
Minutes minutes() const noexcept
Milliseconds milliseconds() const noexcept
Seconds seconds() const noexcept
Int64 Ticks
Integral type presenting internal ticks.
The time point without the time-zone information.
static Timestamp fromStr(const std::string &, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSnsec)
De-serializes a timestamp from the given string.
OnixS::CME::iLink3::Messaging::Month::Enum Month
Type presenting the month component.
Microsecond microsecond() const noexcept
UInt32 Hour
Integral type presenting the hour component.
Timestamp(Ticks ticks=0) noexcept
Initializes from the number of ticks since epoch.
Minute minute() const noexcept
void swap(Timestamp &other) noexcept
Exchanges the value.
UInt32 Minute
Integral type presenting the minute component.
TimeSpan time() const noexcept
UInt32 Millisecond
Integral type presenting the millisecond component.
UInt64 Ticks
Integral type storing internal ticks.
Timestamp date() const noexcept
Timestamp & operator=(const Timestamp &other) noexcept
UInt32 Microsecond
Integral type presenting the microsecond component.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
Explicit time-stamp initialization.
UInt32 Second
Integral type presenting the second component.
UInt32 Day
Integral type presenting the day component.
Second second() const noexcept
UInt32 Nanosecond
Integral type presenting the nanosecond component.
Hour hour() const noexcept
UInt32 Year
Integral type presenting the year component.
Ticks sinceEpoch() const noexcept
Millisecond millisecond() const noexcept
Nanosecond nanosecond() const noexcept
Timestamp(const Timestamp &other) noexcept
std::string toString(TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSnsec) const
void toStrAsHHMMSSpsec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.ssssssssssss pattern.
Timestamp makeTimestamp(Timestamp::Ticks ticks) noexcept
Make Timestamp helper.
void toStrAsHHMMSSnsec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.sssssssss pattern.
void toStrAsYYYYMMDDHHMMSSusec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSusec format.
void toStrAsHHMMSSusec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.ssssss pattern.
void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSmsec format.
char Char
Character type alias.
void toStrAsHHMMSSmsec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.sss pattern.
std::string toStr(const FixedPointDecimal< Mantissa, Exponent > &)
Serializes a fixed-point decimal into a string.
void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSS format.
void toStrAsHHMMSS(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS pattern.
void toStrAsYYYYMMDDHHMMSSpsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSpsec format.
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDD format.
void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
Serializes the timespan according to the D.HH:MM:SS.sssssssss pattern.
bool fromStr(Decimal &, const Char *, size_t) noexcept
Deserializes a decimal number from the given text presentation.
void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSnsec format.
Miscellaneous time characteristics.
static constexpr Int32 hoursPerDay() noexcept
static constexpr Int32 nanosecondsPerSecond() noexcept
static constexpr Int32 secondsPerMinute() noexcept
static constexpr Int32 minutesPerHour() noexcept
static constexpr Int64 nanosecondsPerDay() noexcept
static constexpr Int32 microsecondsPerSecond() noexcept
static constexpr Int32 millisecondsPerSecond() noexcept
static constexpr Int64 nanosecondsPerMinute() noexcept
static constexpr Int32 nanosecondsPerMicrosecond() noexcept
static constexpr Int32 nanosecondsPerMillisecond() noexcept
static constexpr Int64 nanosecondsPerHour() noexcept