Replaced dependencies on ace/OS_NS_time.h

This commit is contained in:
leak committed 2014-06-08 20:08:43 +02:00
1 parent fdd5e11a15
commit 0dd10269d1
6 files changed
+136 -122

No files matched your search

+13 -2
View File
@@ -127,6 +127,18 @@ void stripLineInvisibleChars(std::string &str)
}
std::tm localtime_r(const time_t& time)
{
std::tm tm_snapshot;
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
localtime_s(&tm_snapshot, &time);
#else
localtime_r(&time, &tm_snapshot); // POSIX
#endif
return tm_snapshot;
}
std::string secsToTimeString(uint64 timeInSecs, bool shortText, bool hoursOnly)
{
uint64 secs = timeInSecs % MINUTE;
@@ -215,8 +227,7 @@ uint32 TimeStringToSecs(const std::string& timestring)
std::string TimeToTimestampStr(time_t t)
{
tm aTm;
ACE_OS::localtime_r(&t, &aTm);
tm aTm = localtime_r(t);
// YYYY year
// MM month (2 digits 01-12)
// DD day (2 digits 01-31)