We get the date and time of the last file modification.
1 2 3 4 5 6 7 8 |
var filePath: WideString; modDate: string; begin filePath:= 'C:\Windows\explorer.exe'; modDate:= getFileModificateDate(filePath); ShowMessage(modDate); end; |
Options
filePath - path to the scanned file
Result
A string in the format dd.mm.yyyy hh.mm.ss or an empty string if unsuccessful.
1 2 3 4 5 6 7 8 |
function getFileModificateDate(filePath: string): string; begin try Result:= DateTimeToStr(FileDateToDateTime(FileAge(filePath))); except Result:= ''; end; end; |