FILETIME

Far Manager

FILETIME

The FILETIME data structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601. It is the means by which Win32 determines the date and time.
typedef struct _FILETIME {
  DWORD dwLowDateTime;
  DWORD dwHighDateTime;
} FILETIME; 

Members

dwLowDateTime
Specifies the low-order 32 bits of the Win32 date/time value.
dwHighDateTime
Specifies the high-order 32 bits of the Win32 date/time value.

Remarks

It is not recommended that you add or substract values from this structure to obtain relative times. Instead, you should do the following:

  • Copy this structure to a ULARGE_INTEGER structure.
  • Use standard 64-bit arithmetic on the ULARGE_INTEGER value or cast a variable of FILETIME type to the __int64 type:
    FILETIME WriteTime1, WriteTime2;
    
    if(*(__int64*) & WriteTime1 == *(__int64*) & WriteTime2)
     ...
    
Not all file systems can record creation and last access time and not all file systems record them in the same manner. For example, on NT FAT, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (really, the access date). On NTFS, access time has a resolution of 1 hour. Therefore, the GetFileTime function may not return the same file time information set using the SetFileTime function. Furthermore, FAT records times on disk in local time. However, NTFS records times on disk in UTC.

See also: