Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

FILETIME structure (minwinbase.h)

Feedback

In this article

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, *LPFILETIME;

Members

dwLowDateTime

The low-order part of the file time.

dwHighDateTime

The high-order part of the file time.

Remarks

To convert aFILETIME structure into a time that is easy to display to a user, use theFileTimeToSystemTime function.

It is not recommended that you add and subtract values from theFILETIME structure to obtain relative times. Instead, you should copy the low- and high-order parts of the file time to aULARGE_INTEGER structure, perform 64-bit arithmetic on theQuadPart member, and copy theLowPart andHighPart members into theFILETIME structure.

Do not cast a pointer to aFILETIME structure to either aULARGE_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, theGetFileTime function may not return the same file time information set using theSetFileTime function. Furthermore, FAT records times on disk in local time. However, NTFS records times on disk in UTC. For more information, seeFile Times.

A function using theFILETIME structure can allow for values outside of zero or positive values typically specified by thedwLowDateTime anddwHighDateTime members. For example, theSetFileTime 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, seeChanging a File Time to the Current Time orRetrieving the Last-Write Time.

Requirements

RequirementValue
Minimum supported clientWindows 2000 Professional [desktop apps | UWP apps]
Minimum supported serverWindows 2000 Server [desktop apps | UWP apps]
Headerminwinbase.h (include Windows.h)

See also

CompareFileTime

File Times

FileTimeToSystemTime

GetFileTime

ULARGE_INTEGER


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?