diff options
author | rtk0c <[email protected]> | 2022-06-30 21:38:53 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-30 21:38:53 -0700 |
commit | 7fe47a9d5b1727a61dc724523b530762f6d6ba19 (patch) | |
tree | e95be6e66db504ed06d00b72c579565bab873277 /core/src/Utils/Time.cpp | |
parent | 2cf952088d375ac8b2f45b144462af0953436cff (diff) |
Restructure project
Diffstat (limited to 'core/src/Utils/Time.cpp')
-rw-r--r-- | core/src/Utils/Time.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/core/src/Utils/Time.cpp b/core/src/Utils/Time.cpp deleted file mode 100644 index 4e79ffa..0000000 --- a/core/src/Utils/Time.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "Time.hpp" - -#include <ctime> - -std::string TimeUtils::StringifyTimePoint(std::chrono::time_point<std::chrono::system_clock> tp) -{ - auto t = std::chrono::system_clock::to_time_t(tp); - - char data[32]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // C++ doesn't have std::localtime_s - std::strftime(data, sizeof(data), "%Y-%m-%d %H:%M:%S", std::localtime(&t)); -#pragma clang diagnostic pop - - return std::string(data); -} - -std::string TimeUtils::StringifyTimeStamp(int64_t timeStamp) -{ - if (timeStamp == 0) { - return ""; - } - - namespace chrono = std::chrono; - chrono::milliseconds d{ timeStamp }; - chrono::time_point<chrono::system_clock> tp{ d }; - - return StringifyTimePoint(tp); -} |