一直对FILETIME中的参数不太了解是什么意思, 也不知道怎么比较先后,之前都是转成systemtime再比较,感觉有点麻烦。终于发现有个API可以直接比较,CompareFileTime,具体的可以查MSDN。
CompareFileTime
The CompareFileTime function compares two file times.
LONG CompareFileTime( const FILETIME* lpFileTime1, const FILETIME* lpFileTime2 );
Parameters
-
lpFileTime1
- [in] Pointer to a FILETIME structure that specifies the first file time. lpFileTime2
- [in] Pointer to a FILETIME structure that specifies the second file time.
Return Values
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. |