2#include "Core/Common/Types.h"
12 using ClockType = chrono::system_clock;
13 using TimePoint = ClockType::time_point;
19 : m_point(ClockType::now())
35 const auto time = chrono::current_zone()->to_local(m_point);
36 return std::format(
"{:%Y-%m-%d %X}", time);
45 const auto time = chrono::current_zone()->to_local(m_point);
46 return std::format(
"{:%Y-%m-%d}", time);
55 const auto time = chrono::current_zone()->to_local(m_point);
56 return std::format(
"{:%X}", time);
63 inline operator TimePoint()
const
Timestamp utility class, wraps chrono::system_clock::time_point.
Definition Timestamp.h:10
Timestamp(const TimePoint &point)
Constructor, sets timestamp to specified time.
Definition Timestamp.h:25
String GetDate() const
Get formatted date (Format: "YYYY-MM-DD")
Definition Timestamp.h:43
Timestamp()
Default constructor, sets timestamp to current time.
Definition Timestamp.h:18
String GetDateAndTime() const
Get formatted date and time (Format: "YYYY-MM-DD HH:MM:SS`")
Definition Timestamp.h:33
String GetTime() const
Get formatted time (Format: "HH:MM:SS")
Definition Timestamp.h:53