diff options
Diffstat (limited to 'src/server/shared/Utilities/Util.cpp')
-rw-r--r-- | src/server/shared/Utilities/Util.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index c766cc3ca91..f80730af05d 100644 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -139,15 +139,14 @@ void stripLineInvisibleChars(std::string &str) } -std::tm localtime_r(const time_t& time) +struct tm* localtime_r(const time_t* time, struct tm *result) { - std::tm tm_snapshot; #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) - localtime_s(&tm_snapshot, &time); + localtime_s(result, time); + return result; #else - localtime_r(&time, &tm_snapshot); // POSIX + return localtime_r(&time, &result); // POSIX #endif - return tm_snapshot; } @@ -239,7 +238,8 @@ uint32 TimeStringToSecs(const std::string& timestring) std::string TimeToTimestampStr(time_t t) { - tm aTm = localtime_r(t); + tm aTm; + localtime_r(&t, &aTm); // YYYY year // MM month (2 digits 01-12) // DD day (2 digits 01-31) |