summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-03 19:52:21 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-03 19:52:21 +0300
commitf9d21161af483faa291f182c3607cc6298cf6be6 (patch)
tree7b33d63bedfbd63c3c7ee1aa52144a19794d1e6f /src/utils/stringutils.cpp
parenta361e595a3f8494903d8d66501cca2fe5b80307a (diff)
downloadmanaplus-f9d21161af483faa291f182c3607cc6298cf6be6.tar.gz
manaplus-f9d21161af483faa291f182c3607cc6298cf6be6.tar.bz2
manaplus-f9d21161af483faa291f182c3607cc6298cf6be6.tar.xz
manaplus-f9d21161af483faa291f182c3607cc6298cf6be6.zip
Use date with time in seen and id logging files.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp11
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);