ObjectPascal
FileDateToDateTime
Function
Converts a file date/time format to a TDateTime value SysUtils unit
 function FileDateToDateTime ( const FileDate : Integer ) : TDateTime;
Description
The FileDateToDateTime function converts an Integer FileDate value (as obtained from FileAge for example) to a more manageable TDateTime format.
 
There are many routines in Delphi that can work on this TDateTime format.
Related commands
DateTimeToFileDate Convert a TDateTime value to a File date/time format
FileAge Get the last modified date/time of a file without opening it
FileSetDate Set the last modified date and time of a file
 
Example code : Convert the last modified date of a file into a TDateTime value
var
  fileName   : string;
  fileDate   : Integer;

begin
  // Try to open the Unit1.DCU file for the current project
  fileName := 'Unit1.DCU';
  fileDate := FileAge(fileName);

  // Did we get the file age OK?
  if fileDate > -1 then
    ShowMessage(fileName+' last modified date = '+
                DateToStr(FileDateToDateTime(fileDate)));
end;
Show full unit code
   Unit1.DCU last modified date = 10/11/2002