關於FILETIME的比較

一直對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 valueDescription

-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.
發佈了15 篇原創文章 · 獲贊 15 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章