diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-01 16:42:35 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-01 16:42:35 +0500 |
| commit | 4239a31c5928981b1582a7762458b080b8fda5ff (patch) | |
| tree | f9b798dcedeac5f1751c6420b5572256a088fa33 /src/utils/chrono.hpp | |
| parent | 0d22ee8a01e2822ed89480b0620ee082c223f0dd (diff) | |
feat: method for converting a string to time point
Diffstat (limited to 'src/utils/chrono.hpp')
| -rw-r--r-- | src/utils/chrono.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/chrono.hpp b/src/utils/chrono.hpp index 5d0b3ed..7e85e70 100644 --- a/src/utils/chrono.hpp +++ b/src/utils/chrono.hpp @@ -1,7 +1,11 @@ #pragma once +#include <chrono> #include <string> namespace bot::utils::chrono { std::string format_timestamp(int seconds); + std::chrono::system_clock::time_point string_to_time_point( + const std::string &value, + const std::string &format = "%Y-%m-%d %H:%M:%S"); } |
