MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ConvertFileTimeToUnixTime

Function ConvertFileTimeToUnixTime

common/FileSystem.cpp:51–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49#ifdef _WIN32
50
51static std::time_t ConvertFileTimeToUnixTime(const FILETIME& ft)
52{
53 // based off https://stackoverflow.com/a/6161842
54 static constexpr s64 WINDOWS_TICK = 10000000;
55 static constexpr s64 SEC_TO_UNIX_EPOCH = 11644473600LL;
56
57 const s64 full = static_cast<s64>((static_cast<u64>(ft.dwHighDateTime) << 32) | static_cast<u64>(ft.dwLowDateTime));
58 return static_cast<std::time_t>(full / WINDOWS_TICK - SEC_TO_UNIX_EPOCH);
59}
60
61template <class T>
62static bool IsUNCPath(const T& path)

Callers 2

RecursiveFindFilesFunction · 0.85
StatFileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected