Valhalla Legends Archive

Programming => General Programming => Topic started by: Eric on March 26, 2004, 06:05 PM

Title: System/File Time Conversions
Post by: Eric on March 26, 2004, 06:05 PM
Is there any way to convert Unix system/file times to Windows system/file times?
Title: Re:System/File Time Conversions
Post by: Skywing on March 26, 2004, 06:45 PM
Quote from: LoRd[nK] on March 26, 2004, 06:05 PM
Is there any way to convert Unix system/file times to Windows system/file times?
Something like this...:

typedef unsigned __int64 ulong64;
FILETIME WindowsTime;
time_t UnixTime;

GetSystemTimeAsFileTime(&WindowsTime);

UnixTime = ((((ulong64)WindowsTime.dwHighDateTime << 32) | WindowsTime.dwLowDateTime) - 116444736000000000i64) / 10000000i64;

The Visual C++ sources would also be a good place to look for information on how to do this if you have them available.