NetKDTime: Use UTC timestamp

This commit is contained in:
John Papetti 2023-01-12 22:48:24 -05:00
parent 10fd768898
commit e2db9cd142
No known key found for this signature in database
GPG Key ID: 918E12C2B94FD0EF
1 changed files with 6 additions and 2 deletions

View File

@ -91,7 +91,9 @@ u64 NetKDTimeDevice::GetAdjustedUTC() const
{ {
using namespace ExpansionInterface; 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); return u64(s64(emulated_time) + utcdiff);
} }
@ -99,7 +101,9 @@ void NetKDTimeDevice::SetAdjustedUTC(u64 wii_utc)
{ {
using namespace ExpansionInterface; 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); utcdiff = s64(emulated_time - wii_utc);
} }
} // namespace IOS::HLE } // namespace IOS::HLE