#pragma once #include #include #include #include #if (__cpp_lib_chrono < 201907L) # include #endif namespace scwx { namespace util { #if (__cpp_lib_chrono >= 201907L) typedef std::chrono::time_zone time_zone; #else typedef date::time_zone time_zone; #endif enum class ClockFormat { _12Hour, _24Hour, Unknown }; typedef scwx::util:: Iterator ClockFormatIterator; ClockFormat GetClockFormat(const std::string& name); const std::string& GetClockFormatName(ClockFormat clockFormat); std::chrono::system_clock::time_point TimePoint(uint32_t modifiedJulianDate, uint32_t milliseconds); std::string TimeString(std::chrono::system_clock::time_point time, ClockFormat clockFormat = ClockFormat::_24Hour, const time_zone* timeZone = nullptr, bool epochValid = true); template std::optional> TryParseDateTime(const std::string& dateTimeFormat, const std::string& str); } // namespace util } // namespace scwx