| 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 |
no outgoing calls
no test coverage detected