From 373a1a5dc04b0ddc1d058d6303ef154dbc1c5246 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sun, 16 Mar 2025 00:29:05 -0500 Subject: Update min win10 version from 1703/15063 to 1903/18362 Co-authored-by: Shawn Hoffman --- Source/Core/Common/build_info.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common') diff --git a/Source/Core/Common/build_info.txt.in b/Source/Core/Common/build_info.txt.in index 5d658d95e6..03b52f60f4 100644 --- a/Source/Core/Common/build_info.txt.in +++ b/Source/Core/Common/build_info.txt.in @@ -1,6 +1,6 @@ // Indicate the minimum OS version required for the binary to run properly. // Updater will fail the update if the user does not meet this requirement. -OSMinimumVersionWin10=10.0.15063.0 +OSMinimumVersionWin10=10.0.18362.0 OSMinimumVersionWin11=10.0.22000.0 // This is the runtime which was compiled against - providing a way for Updater to detect if update -- cgit v1.2.3 From c1dea828ab311ac68b85136a97695f447b3b2574 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sun, 16 Mar 2025 00:32:54 -0500 Subject: Common: use std::chrono for GetLocalTimeSinceJan1970 on Windows Co-authored-by: Shawn Hoffman --- Source/Core/Common/Timer.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Source/Core/Common') diff --git a/Source/Core/Common/Timer.cpp b/Source/Core/Common/Timer.cpp index 91381eebd3..fb81164390 100644 --- a/Source/Core/Common/Timer.cpp +++ b/Source/Core/Common/Timer.cpp @@ -7,7 +7,6 @@ #ifdef _WIN32 #include -#include #include #else #include @@ -68,10 +67,12 @@ u64 Timer::ElapsedMs() const u64 Timer::GetLocalTimeSinceJan1970() { - // TODO Would really, really like to use std::chrono here, but Windows did not support - // std::chrono::current_zone() until 19H1, and other compilers don't even provide support for - // timezone-related parts of chrono. Someday! - // see https://bugs.dolphin-emu.org/issues/13007#note-4 +#ifdef _MSC_VER + std::chrono::zoned_seconds seconds( + std::chrono::current_zone(), + std::chrono::time_point_cast(std::chrono::system_clock::now())); + return seconds.get_local_time().time_since_epoch().count(); +#else time_t sysTime, tzDiff, tzDST; time(&sysTime); tm* gmTime = localtime(&sysTime); @@ -87,6 +88,7 @@ u64 Timer::GetLocalTimeSinceJan1970() tzDiff = sysTime - mktime(gmTime); return static_cast(sysTime + tzDiff + tzDST); +#endif } void Timer::IncreaseResolution() -- cgit v1.2.3