3#include <Foundation/Basics.h>
4#include <Foundation/Math/Math.h>
10 return m_iTimestamp != PL_INVALID_TIME_STAMP;
15 PL_ASSERT_DEBUG(
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
21 PL_ASSERT_DEBUG(
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
27 PL_ASSERT_DEBUG(
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
28 PL_ASSERT_DEBUG(other.
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
34 PL_ASSERT_DEBUG(
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
40 PL_ASSERT_DEBUG(
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
46 PL_ASSERT_DEBUG(timestamp.
IsValid(),
"Arithmetics on invalid time stamps are not allowed!");
69 PL_ASSERT_DEBUG(uiMonth >= 1 && uiMonth <= 12,
"Invalid month value");
80 PL_ASSERT_DEBUG(uiDay >= 1 && uiDay <= 31,
"Invalid day value");
91 PL_ASSERT_DEBUG(uiDayOfWeek <= 6,
"Invalid day of week value");
92 m_uiDayOfWeek = uiDayOfWeek;
102 PL_ASSERT_DEBUG(uiHour <= 23,
"Invalid hour value");
113 PL_ASSERT_DEBUG(uiMinute <= 59,
"Invalid minute value");
114 m_uiMinute = uiMinute;
124 PL_ASSERT_DEBUG(uiSecond <= 59,
"Invalid second value");
125 m_uiSecond = uiSecond;
130 return m_uiMicroseconds;
135 PL_ASSERT_DEBUG(uiMicroSeconds <= 999999u,
"Invalid micro-second value");
136 m_uiMicroseconds = uiMicroSeconds;
void SetHour(plUInt8 uiHour)
Sets the hour to the given value. Asserts that the value is in the valid range [0,...
Definition Timestamp_inl.h:100
void SetYear(plInt16 iYear)
Sets the year to the given value.
Definition Timestamp_inl.h:57
plUInt8 GetDayOfWeek() const
Returns the currently set day of week.
Definition Timestamp_inl.h:84
void SetMicroseconds(plUInt32 uiMicroSeconds)
Sets the microseconds to the given value. Asserts that the value is in the valid range [0,...
Definition Timestamp_inl.h:133
plUInt8 GetMinute() const
Returns the currently set minute.
Definition Timestamp_inl.h:106
void SetDayOfWeek(plUInt8 uiDayOfWeek)
Sets the day of week to the given value. Asserts that the value is in the valid range [0,...
Definition Timestamp_inl.h:89
plUInt32 GetMicroseconds() const
Returns the currently set microseconds.
Definition Timestamp_inl.h:128
plUInt8 GetDay() const
Returns the currently set day.
Definition Timestamp_inl.h:73
plUInt8 GetSecond() const
Returns the currently set second.
Definition Timestamp_inl.h:117
plUInt8 GetMonth() const
Returns the currently set month.
Definition Timestamp_inl.h:62
void SetDay(plUInt8 uiDay)
Sets the day to the given value. Asserts that the value is in the valid range [1, 31].
Definition Timestamp_inl.h:78
void SetMonth(plUInt8 uiMonth)
Sets the month to the given value. Asserts that the value is in the valid range [1,...
Definition Timestamp_inl.h:67
plUInt32 GetYear() const
Returns the currently set year.
Definition Timestamp_inl.h:52
void SetMinute(plUInt8 uiMinute)
Sets the minute to the given value. Asserts that the value is in the valid range [0,...
Definition Timestamp_inl.h:111
plUInt8 GetHour() const
Returns the currently set hour.
Definition Timestamp_inl.h:95
void SetSecond(plUInt8 uiSecond)
Sets the second to the given value. Asserts that the value is in the valid range [0,...
Definition Timestamp_inl.h:122
The timestamp class encapsulates a date in time as microseconds since Unix epoch.
Definition Timestamp.h:23
void operator-=(const plTime &timeSpan)
Subtracts the time value of "timeSpan" from this date value.
Definition Timestamp_inl.h:19
bool IsValid() const
Returns whether the timestamp is valid.
Definition Timestamp_inl.h:8
void operator+=(const plTime &timeSpan)
Adds the time value of "timeSpan" to this data value.
Definition Timestamp_inl.h:13
plTimestamp()
Creates an invalidated timestamp.
const plTimestamp operator+(const plTime &timeSpan) const
Returns a timestamp that is "timeSpan" further into the future from this timestamp.
Definition Timestamp_inl.h:32
plInt64 GetInt64(plSIUnitOfTime::Enum unitOfTime) const
Returns the number of 'unitOfTime' since Unix epoch.
Definition Timestamp.cpp:17
static plTimestamp MakeFromInt(plInt64 iTimeValue, plSIUnitOfTime::Enum unitOfTime)
Returns a timestamp initialized from 'iTimeValue' in 'unitOfTime' since Unix epoch.
Definition Timestamp.cpp:36
const plTime operator-(const plTimestamp &other) const
Returns the time span between this timestamp and "other".
Definition Timestamp_inl.h:25
@ Microsecond
SI-unit of time (10^-6 second)
Definition Timestamp.h:11
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
constexpr double GetMicroseconds() const
Returns the microseconds value.
Definition Time_inl.h:20
PL_ALWAYS_INLINE static constexpr plTime MakeFromMicroseconds(double fMicroseconds)
Creates an instance of plTime that was initialized from microseconds.
Definition Time.h:22