# Function Reference

FileGetTime

Returns the time and date information for a file.

FileGetTime ( "filename" [, option [, format]] )

Parameters

filename | Filename to check.
option | [optional] Flag to indicate which timestamp 0 = Modified (default) 1 = Created 2 = Accessed
format | [optional] to specify type of return 0 = return an array (default) 1 = return a string YYYYMMDDHHMMSS

Return Value

Success: | Returns an array or string that contains the file time information. See Remarks.
Failure: | Returns 0 and sets @error to 1.

Remarks

The array is a single dimension array containing six elements:
$array[0] = year (four digits)
$array[1] = month (range 01 - 12)
$array[2] = day (range 01 - 31)
$array[3] = hour (range 00 - 23)
$array[4] = min (range 00 - 59)
$array[5] = sec (range 00 - 59)
Notice that return values are zero-padded.

Related

FileGetSize, FileGetAttrib, FileGetVersion, FileSetTime

Example

$t = FileGetTime(@Windowsdir & "\Notepad.exe", 1)
If Not @error Then
$yyyymd = $t[0] & "/" & $t[1] & "/" & $t[2]
MsgBox(0, "Creation date of notepad.exe", $yyyymd)
EndIf