38 return 86400000000000ll;
45 return 3600000000000ll;
192 numericCast<Ticks>(
days) *
194 numericCast<Ticks>(
hours) *
213 numericCast<Ticks>(
hours) *
251 numericCast<Minutes>(
264 numericCast<Seconds>(
277 numericCast<Milliseconds>
290 numericCast<Microseconds>
303 numericCast<Nanoseconds>
320 ticks_ += other.ticks_;
328 ticks_ -= other.ticks_;
336 std::swap(ticks_, other.ticks_);
353 return left.ticks() == right.ticks();
360 return left.ticks() != right.ticks();
367 return left.ticks() < right.ticks();
374 return left.ticks() > right.ticks();
479 typedef ONIXS_ICEBOE_MESSAGING_NAMESPACE::Month::Enum
Month;
532 : sinceEpoch_(other.sinceEpoch_)
569 return static_cast<Hour>(
time().hours());
629 sinceEpoch_ = other.sinceEpoch_;
637 std::swap(sinceEpoch_, other.sinceEpoch_);
652 static Ticks toTicks(Year,
Month,
Day, Hour, Minute, Second, Nanosecond);
656 static void toDate(Ticks, Year&,
Month&,
Day&);
732 timestamp.sinceEpoch() +
743 timestamp.sinceEpoch() -
752 return TimeSpan(left.sinceEpoch() - right.sinceEpoch());
799inline std::ostream & operator <<(std::ostream & os,
const Timestamp& value)
801 return os <<
toStr(value);
805std::ostream & operator <<(std::ostream & os,
const TimeSpan& value)
807 return os <<
toStr(value);
819 return fromStr(ts, str.data(), str.size());
825 return fromStr(ts, str.data(), str.size());
860 throw std::runtime_error(
"Error parsing Timestamp, invalid value: '" +
toStr(str) +
"'.");
879 throw std::runtime_error(
"Error parsing TimeSpan, invalid value: '" +
toStr(str) +
"'.");
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE_END
#define ONIXS_ICEBOE_EXPORTED
#define ONIXS_ICEBOE_PURE
#define ONIXS_ICEBOE_NODISCARD
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(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.
constexpr TimeSpan(Ticks ticks=0) noexcept
Initializes the timespan from the given number of ticks.
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.
Microsecond microsecond() const noexcept
UInt32 Hour
Integral type presenting the hour component.
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.
constexpr Timestamp(Ticks ticks=0) noexcept
Initializes from the number of ticks since epoch.
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.
OnixS::ICE::BOE::Messaging::Month::Enum Month
Type presenting the month 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.
bool operator>=(const Decimal &left, const Decimal &right)
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.
bool operator>(const Decimal &left, const Decimal &right)
std::string format(Int32 index, StrRef input)
bool operator!=(const Decimal &left, const Decimal &right)
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.
std::basic_string_view< Char > StrRef
bool operator<=(const Decimal &left, const Decimal &right)
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDD format.
bool operator<(const Decimal &left, const Decimal &right) noexcept
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.
bool operator==(const Decimal &left, const Decimal &right) noexcept
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