Getting the modified date of a file
   


This function will return the modified date of a file in a string format. You can replace DateTimeToStr() with FormatDateTime() to format the string to your taste, or change the result to be a TDateTime instead of a string.

function GetModifiedDate(FileToCheck: string): string;
{ Func to return the modified date of a file. }
var
  L : LongInt;
  D : TDateTime;
begin
  Result := '';
  L := FileAge(FileToCheck);
  if (L <> -1) then
    begin
      D := FileDateToDateTime(L);
      Result := DateTimeToStr(D);
    end;
end;


Blue Orb Software

[email protected]