3#include <Foundation/Reflection/Reflection.h>
4#include <Foundation/Time/Time.h>
39 PL_DECLARE_POD_TYPE();
65 bool Compare(
const plTimestamp& rhs, CompareMode::Enum mode)
const;
70 void operator+=(
const plTime& timeSpan);
73 void operator-=(
const plTime& timeSpan);
90 plInt64 m_iTimestamp = PL_INVALID_TIME_STAMP;
96PL_DECLARE_REFLECTABLE_TYPE(PL_FOUNDATION_DLL,
plTimestamp);
112 bool IsValid()
const;
128 [[nodiscard]]
const plTimestamp GetTimestamp()
const;
140 plUInt32 GetYear()
const;
143 void SetYear(plInt16 iYear);
146 plUInt8 GetMonth()
const;
149 void SetMonth(plUInt8 uiMonth);
152 plUInt8 GetDay()
const;
155 void SetDay(plUInt8 uiDay);
158 plUInt8 GetDayOfWeek()
const;
161 void SetDayOfWeek(plUInt8 uiDayOfWeek);
164 plUInt8 GetHour()
const;
167 void SetHour(plUInt8 uiHour);
170 plUInt8 GetMinute()
const;
173 void SetMinute(plUInt8 uiMinute);
176 plUInt8 GetSecond()
const;
179 void SetSecond(plUInt8 uiSecond);
182 plUInt32 GetMicroseconds()
const;
185 void SetMicroseconds(plUInt32 uiMicroSeconds);
189 plUInt32 m_uiMicroseconds = 0;
193 plUInt8 m_uiMonth = 0;
197 plUInt8 m_uiDayOfWeek = 0;
199 plUInt8 m_uiHour = 0;
201 plUInt8 m_uiMinute = 0;
203 plUInt8 m_uiSecond = 0;
212 ShowDate = PL_BIT(0),
213 TextualDate = ShowDate | PL_BIT(1),
214 ShowWeekday = PL_BIT(2),
215 ShowTime = PL_BIT(3),
216 ShowSeconds = ShowTime | PL_BIT(4),
217 ShowMilliseconds = ShowSeconds | PL_BIT(5),
218 ShowTimeZone = PL_BIT(6),
220 Default = ShowDate | ShowSeconds,
221 DefaultTextual = TextualDate | ShowSeconds,
231 , m_uiFormattingFlags(uiFormattingFlags)
236 plUInt32 m_uiFormattingFlags;
241#include <Foundation/Time/Implementation/Timestamp_inl.h>
The plDateTime class can be used to convert plTimestamp into a human readable form.
Definition Timestamp.h:103
plDateTime()
Creates an empty date time instance with an invalid date.
static plDateTime MakeZero()
Returns a date time that is all zero.
Definition Timestamp.h:115
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
The timestamp class encapsulates a date in time as microseconds since Unix epoch.
Definition Timestamp.h:23
plTimestamp()
Creates an invalidated timestamp.
static plTimestamp MakeInvalid()
Returns an invalid timestamp.
Definition Timestamp.h:47
constexpr TYPE MinValue()
Returns the smallest possible value (that is not -infinity). Usually zero or -MaxValue()....
Definition Timestamp.h:209
plArgDateTime(const plDateTime &dateTime, plUInt32 uiFormattingFlags=Default)
Initialized a formatting object for an plDateTime instance.
Definition Timestamp.h:229
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Enum
Definition Timestamp.h:9
@ Second
SI-unit of time (base unit)
Definition Timestamp.h:13
@ Microsecond
SI-unit of time (10^-6 second)
Definition Timestamp.h:11
@ Nanosecond
SI-unit of time (10^-9 second)
Definition Timestamp.h:10
@ Millisecond
SI-unit of time (10^-3 second)
Definition Timestamp.h:12
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
Definition Timestamp.h:26
Enum
Definition Timestamp.h:28
@ FileTimeEqual
Uses a resolution that guarantees that a file's timestamp is considered equal on all platforms.
Definition Timestamp.h:29
@ Newer
Just compares values and returns true if the left-hand side is larger than the right hand side.
Definition Timestamp.h:31
@ Identical
Uses maximal stored resolution.
Definition Timestamp.h:30