Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
Syntax
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, *PFILETIME;
Members
- dwLowDateTime
The low-order part of the file time.
- dwHighDateTime
The high-order part of the file time.
Remarks
To convert a
FILETIME structure into a time that is easy to display to a user, use the
FileTimeToSystemTime function.
It is not recommended that you add and subtract values from the
FILETIME structure to obtain relative times. Instead, you should copy the low- and high-order parts of the file time to a ULARGE_INTEGER structure, perform 64-bit arithmetic on the QuadPart member, and copy the LowPart and HighPart members into the FILETIME structure.
Do not cast a pointer to a FILETIME structure to either a ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
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. For more information, see
File Times.
The dwLowDateTime and dwHighDateTime members are typically zero or positive values, unless the function using the FILETIME structure allows different values such as 0xFFFFFFFF. For example, the SetFileTime function uses 0xFFFFFFFF to specify that a file's previous access time should be preserved. For more information, see the topic for the function you are calling.
Examples
For an example, see
Changing a File Time to the Current Time or Retrieving the Last-Write Time.
Requirements
Minimum supported client | Windows 2000 Professional |
Minimum supported server | Windows 2000 Server |
Header | Winbase.h (include Windows.h) |
See Also
- File Times
- CompareFileTime
- FileTimeToSystemTime
- GetFileTime
- ULARGE_INTEGER
Send comments about this topic to Microsoft
Build date: 2/4/2010