summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar lat9nq2023-05-21 02:43:15 -0400
committerGravatar lat9nq2023-06-05 15:15:11 -0400
commit9e2164be74d9049877092771155ba306140a320b (patch)
tree2a75615667756d9aa7e1b3f5cfdc1e2e510ebba5 /src/core
parenttz_content_manager: Detect system time zone (diff)
downloadyuzu-9e2164be74d9049877092771155ba306140a320b.tar.gz
yuzu-9e2164be74d9049877092771155ba306140a320b.tar.xz
yuzu-9e2164be74d9049877092771155ba306140a320b.zip
time_manager: Don't offset RTC by system time zone
This causes the emulated system's universal time to be on the user's clock, and the user time to be off if they set a time zone. time_manager: Remove GetExternalRtcTime
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/time/time_manager.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp
index 28667710e..d5c9e6b5e 100644
--- a/src/core/hle/service/time/time_manager.cpp
+++ b/src/core/hle/service/time/time_manager.cpp
@@ -22,10 +22,6 @@ s64 GetSecondsSinceEpoch() {
22 return std::chrono::duration_cast<std::chrono::seconds>(time_since_epoch).count() + 22 return std::chrono::duration_cast<std::chrono::seconds>(time_since_epoch).count() +
23 Settings::values.custom_rtc_differential; 23 Settings::values.custom_rtc_differential;
24} 24}
25
26s64 GetExternalRtcValue() {
27 return GetSecondsSinceEpoch() + TimeManager::GetExternalTimeZoneOffset();
28}
29} // Anonymous namespace 25} // Anonymous namespace
30 26
31struct TimeManager::Impl final { 27struct TimeManager::Impl final {
@@ -43,7 +39,7 @@ struct TimeManager::Impl final {
43 std::make_shared<Clock::EphemeralNetworkSystemClockContextWriter>()}, 39 std::make_shared<Clock::EphemeralNetworkSystemClockContextWriter>()},
44 time_zone_content_manager{system} { 40 time_zone_content_manager{system} {
45 41
46 const auto system_time{Clock::TimeSpanType::FromSeconds(GetExternalRtcValue())}; 42 const auto system_time{Clock::TimeSpanType::FromSeconds(GetSecondsSinceEpoch())};
47 SetupStandardSteadyClock(system, Common::UUID::MakeRandom(), system_time, {}, {}); 43 SetupStandardSteadyClock(system, Common::UUID::MakeRandom(), system_time, {}, {});
48 SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds()); 44 SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds());
49 45