diff --git a/Source/Core/Core/IOS/DolphinDevice.cpp b/Source/Core/Core/IOS/DolphinDevice.cpp index 558ef58809..85a71a83c2 100644 --- a/Source/Core/Core/IOS/DolphinDevice.cpp +++ b/Source/Core/Core/IOS/DolphinDevice.cpp @@ -241,7 +241,10 @@ IPCReply DolphinDevice::GetSystemTime(const IOCtlVRequest& request) const return IPCReply(IPC_EINVAL); } - const u64 milliseconds = std::time(nullptr); + // Write Unix timestamp in milliseconds to memory address + const u64 milliseconds = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count(); Memory::Write_U64(milliseconds, request.io_vectors[0].address); return IPCReply(IPC_SUCCESS); } diff --git a/Source/Core/UICommon/DiscordPresence.cpp b/Source/Core/UICommon/DiscordPresence.cpp index f269c27c0a..ff0afb5d25 100644 --- a/Source/Core/UICommon/DiscordPresence.cpp +++ b/Source/Core/UICommon/DiscordPresence.cpp @@ -290,7 +290,9 @@ void UpdateDiscordPresence(int party_size, SecretType type, const std::string& s discord_presence.smallImageText = "Dolphin is an emulator for the GameCube and the Wii."; } discord_presence.details = title.empty() ? "Not in-game" : title.c_str(); - discord_presence.startTimestamp = std::time(nullptr); + discord_presence.startTimestamp = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count(); if (party_size > 0) {