diff options
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 03f33688c..ebaee1b4b 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -709,6 +709,17 @@ std::string getDateString() return std::string(buffer); } +std::string getDateTimeString() +{ + char buffer[80]; + time_t rawtime; + time(&rawtime); + const tm *const timeinfo = localtime(&rawtime); + + strftime(buffer, 79, "%Y-%m-%d %H:%M:%S", timeinfo); + return std::string(buffer); +} + signed char parseBoolean(const std::string &value) { const std::string opt = value.substr(0, 1); |