mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Merge pull request #145 from CookiePLMonster/y2038-fix
Fix a Y2038 bug in timeToFILETIME
This commit is contained in:
commit
3e5b930d96
@ -2241,10 +2241,10 @@ GHC_INLINE time_t timeFromFILETIME(const FILETIME& ft)
|
||||
|
||||
GHC_INLINE void timeToFILETIME(time_t t, FILETIME& ft)
|
||||
{
|
||||
LONGLONG ll;
|
||||
ll = Int32x32To64(t, 10000000) + 116444736000000000;
|
||||
ft.dwLowDateTime = static_cast<DWORD>(ll);
|
||||
ft.dwHighDateTime = static_cast<DWORD>(ll >> 32);
|
||||
ULARGE_INTEGER ull;
|
||||
ull.QuadPart = static_cast<ULONGLONG>((t * 10000000LL) + 116444736000000000LL);
|
||||
ft.dwLowDateTime = ull.LowPart;
|
||||
ft.dwHighDateTime = ull.HighPart;
|
||||
}
|
||||
|
||||
template <typename INFO>
|
||||
|
Loading…
x
Reference in New Issue
Block a user