function GetFileAltertTime(FileName: string): string; begin Result := FormatDateTime('yyyy-mm-dd hh:nn:ss', FileDateToDateTime(FileAge(FileName))); end; procedure TForm8.Button1Click(Sender: TObject); begin caption := GetFileAltertTime('C:\Source\1.exe'); end;