Function Reference


_Date_Time_CompareFileTime

Compares two file times

#include <Date.au3>
_Date_Time_CompareFileTime ( $tFileTime1, $tFileTime2 )

Parameters

$tFileTime1 first $tagFILETIME structure or a pointer to it
$tFileTime2 second $tagFILETIME structure or a pointer to it

Return Value

Returns one of the following values:
    -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

Related

$tagFILETIME

Example

#include <Date.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $g_idMemo

Example()

Func Example()
        Local $tFileTime1, $tFileTime2

        ; Create GUI
        GUICreate("Time", 400, 300)
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUISetState(@SW_SHOW)

        ; Compare FAT Dates/Times
        $tFileTime1 = _Date_Time_DOSDateTimeToFileTime(0x3621, 0x11EF) ; 01/01/2007 02:15:30
        $tFileTime2 = _Date_Time_DOSDateTimeToFileTime(0x379F, 0x944A) ; 31/12/2007 18:34:20

        MemoWrite("Result 1: " & _Date_Time_CompareFileTime($tFileTime1, $tFileTime2))
        MemoWrite("Result 2: " & _Date_Time_CompareFileTime($tFileTime1, $tFileTime1))
        MemoWrite("Result 3: " & _Date_Time_CompareFileTime($tFileTime2, $tFileTime1))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

; Write a line to the memo control
Func MemoWrite($sMessage)
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite