How to get a file's date and time stamp.

By: Borland Staff

 Technical Information Database

TI541D.txt   How to get a file's date and time stamp.
Category   :General Programming
Platform    :All
Product    :Delphi  All

Description:
Q:  How do I get a file's date and time stamp?

A:

function GetFileDate(TheFileName: string): string;
var
  FHandle: integer;
begin
  FHandle := FileOpen(TheFileName, 0);
  try
    Result := DateTimeToStr(FileDateToDateTime(FileGetDate(FHandle)));
  finally
    FileClose(FHandle);
  end;
end;



Reference:


7/16/98 4:33:47 PM
 

Server Response from: ETNASC04