MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetDatetimeNowUTC

Function GetDatetimeNowUTC

src/openrct2/platform/Platform.Posix.cpp:423–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421 #endif
422
423 datetime64 GetDatetimeNowUTC()
424 {
425 const datetime64 epochAsTicks = 621355968000000000;
426
427 struct timeval tv;
428 gettimeofday(&tv, NULL);
429
430 // Epoch starts from: 1970-01-01T00:00:00Z
431 // Convert to ticks from 0001-01-01T00:00:00Z
432 uint64_t utcEpochTicks = static_cast<uint64_t>(tv.tv_sec) * 10000000uLL + tv.tv_usec * 10;
433 datetime64 utcNow = epochAsTicks + utcEpochTicks;
434 return utcNow;
435 }
436} // namespace OpenRCT2::Platform
437
438#endif

Callers 2

TryRecordHighscoreMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected