mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 07:07:29 +01:00
Replaced all ACE_OS::localtime_r calls
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user