File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
src/AppInstallerSharedLib Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -146,19 +146,7 @@ namespace AppInstaller::Utility
146146
147147 std::chrono::system_clock::time_point ConvertFiletimeToSystemClock (const FILETIME& fileTime)
148148 {
149- // Windows epoch (1601) to Unix epoch (1970) offset in 100-nanosecond intervals
150- constexpr int64_t EPOCH_DIFFERENCE = 116444736000000000LL ;
151-
152- // Combine FILETIME into a 64-bit value
153- uint64_t fileTimeValue = (static_cast <uint64_t >(fileTime.dwHighDateTime ) << 32 ) | fileTime.dwLowDateTime ;
154-
155- // Convert to 100-nanosecond intervals since Unix epoch
156- int64_t unixTime100ns = static_cast <int64_t >(fileTimeValue) - EPOCH_DIFFERENCE;
157-
158- // Convert to chrono duration (system_clock::duration is usually nanoseconds or microseconds)
159- return std::chrono::system_clock::time_point (
160- std::chrono::duration_cast<std::chrono::system_clock::duration>(
161- std::chrono::nanoseconds (unixTime100ns * 100 )));
149+ return winrt::clock::to_sys (winrt::clock::from_FILETIME (fileTime));
162150 }
163151
164152 std::chrono::system_clock::time_point GetTimePointFromVersion (const UInt64Version& version)
You can’t perform that action at this time.
0 commit comments