CompareFileTime function

Compares two file times.

Syntax

LONG CompareFileTime(
  const FILETIME *lpFileTime1,
  const FILETIME *lpFileTime2
);

Parameters

lpFileTime1

A pointer to a FILETIME structure that specifies the first file time.

lpFileTime2

A pointer to a FILETIME structure that specifies the second file time.

Return Value

The return value is one of the following values.

Return value Description
-1
First file time is earlier than second file time.
0
First file time is equal to second file time.
1
First file time is later than second file time.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header fileapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

FILETIME

File Times

GetFileTime

Time Functions