summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJohn Papetti <39745188+techydude0713@users.noreply.github.com>2023-01-12 22:48:24 -0500
committerJohn Papetti <39745188+techydude0713@users.noreply.github.com>2023-01-17 13:59:01 -0500
commite2db9cd142e6a7af25c347db6fe073335cff7bc1 (patch)
tree296ac65fc5e1151ac26887e720e74c138b884cb0 /Source
parent10fd76889854e2367c39d902d70abf70e1d920f6 (diff)
NetKDTime: Use UTC timestamp
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/IOS/Network/KD/NetKDTime.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp b/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp
index 7f07f0c2a6..88b16c111c 100644
--- a/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp
+++ b/Source/Core/Core/IOS/Network/KD/NetKDTime.cpp
@@ -91,7 +91,9 @@ u64 NetKDTimeDevice::GetAdjustedUTC() const
{
using namespace ExpansionInterface;
- const u32 emulated_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH);
+ const time_t current_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH);
+ tm* const gm_time = gmtime(&current_time);
+ const u32 emulated_time = mktime(gm_time);
return u64(s64(emulated_time) + utcdiff);
}
@@ -99,7 +101,9 @@ void NetKDTimeDevice::SetAdjustedUTC(u64 wii_utc)
{
using namespace ExpansionInterface;
- const u32 emulated_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH);
+ const time_t current_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH);
+ tm* const gm_time = gmtime(&current_time);
+ const u32 emulated_time = mktime(gm_time);
utcdiff = s64(emulated_time - wii_utc);
}
} // namespace IOS::HLE