Skip to content

Commit d20b260

Browse files
authored
Merge pull request #1344 from jolting/gmtimeOnWindows
Use gmtime on Windows
2 parents 179b79a + cce692c commit d20b260

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

modules/mrpt_system/src/datetime.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,12 @@ double mrpt::system::extractDayTimeFromTimestamp(const mrpt::system::TTimeStamp
288288
MRPT_START
289289
ASSERT_(tt != INVALID_TIMESTAMP);
290290

291-
#ifdef _WIN32
292-
SYSTEMTIME sysT;
293-
FileTimeToSystemTime((FILETIME*)&t, &sysT);
294-
return sysT.wHour * 3600.0 + sysT.wMinute * 60.0 + sysT.wSecond + sysT.wMilliseconds * 0.001;
295-
#else
296291
const uint64_t tmp = static_cast<uint64_t>(tt.time_since_epoch().count()) - EPOCH_OFFSET;
297292
const time_t auxTime = static_cast<time_t>(tmp / 10000000U);
298293

299294
tm* ptm = gmtime(&auxTime);
300295
ASSERTMSG_(ptm, "Malformed timestamp");
301296
return ptm->tm_hour * 3600.0 + ptm->tm_min * 60.0 + ptm->tm_sec;
302-
#endif
303297
MRPT_END
304298
}
305299

0 commit comments

Comments
 (0)