FileTimeGetEx

Gets extended time information for a file or directory.

Syntax:

FileTimeGetEx(filename, time-field)

Parameters:

(s) filename specifies a file or directory name.

(i) time-field see below.

Returns:

(s)datetime Returns file time in YmdHms format:(YYYY:MM:DD:HH:MM:SS.)

 

This function is like FileYmdHms, but works with directories as well as files, and lets you specify which time field you want to get.

"Time-field" can be one of the following:

1 file created

2 file last modified

3 file last accessed

This function converts a file time to local time using the users current settings for the time zone and daylight saving time. You must take care when using file times if the user has set the system to automatically adjust for daylight saving time. However, you can us  IntControl 102 to have the function return file times as UTC time. Also see FileCompare.

This function supports extended-length path names.

Example:


oldtime = FileTimeGetEx("C:\windows\win.ini",2)
RunWait("notepad.exe", "win.ini")
newtime = FileTimeGetEx("C:\windows\win.ini",2)
If StrCmp(oldtime, newtime) == 0
   Message("WIN.INI not changed", "Last change was %oldtime%")
Else
   Message("WIN.INI modified", "New time stamp is %newtime%")
EndIf
See Also:

FileTimeGet, FileTimeCode, TimeDate, FileAttrGet, FileTimeTouch, FileTimeSet, FileTimeSeEx, FileYmdHms, FileInfoToArray