diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-17 21:31:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-17 21:31:08 +0300 |
commit | 4cd44430deb5a7efc030839a133fe8510327fc24 (patch) | |
tree | 79558ea0608257be85840cfb8289c20080fdc70b /src/utils/stringutils.cpp | |
parent | 2e84ac20fcf6ec69b40e19c4c6c428db04b70d85 (diff) | |
download | plus-4cd44430deb5a7efc030839a133fe8510327fc24.tar.gz plus-4cd44430deb5a7efc030839a133fe8510327fc24.tar.bz2 plus-4cd44430deb5a7efc030839a133fe8510327fc24.tar.xz plus-4cd44430deb5a7efc030839a133fe8510327fc24.zip |
Update servers list once a day.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 9184ba79d..2be1e5b77 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -609,3 +609,17 @@ bool strStartWith(std::string str1, std::string str2) return false; return str1.substr(0, str2.size()) == str2; } + +std::string getDateString() +{ + char buffer[80]; + + time_t rawtime; + struct tm *timeinfo; + + time (&rawtime); + timeinfo = localtime(&rawtime); + + strftime(buffer, 79, "%Y-%m-%d", timeinfo); + return std::string(buffer); +} |