Получаем дату и время последнего изменения файла.
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; |
Параметры
filePath - путь к проверяемому файлу
Результат
Строка в формате дд.мм.гггг чч.мм.сс или пустая строка в случае неудачи.
1 2 3 4 5 6 7 8 |
function getFileModificateDate(filePath: string): string; begin try Result:= DateTimeToStr(FileDateToDateTime(FileAge(filePath))); except Result:= ''; end; end; |