Converts a file date/time format to a TDateTime value SysUtils unit
 function FileDateToDateTime ( const FileDate : Integer ) : TDateTime;
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
 Author links

 Download this web site as a Windows program.

Example code : Convert the last modified date of a file into a TDateTime value
  fileName   : string;
  fileDate   : Integer;

  // 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 = '+
Show full unit code
   Unit1.DCU last modified date = 10/11/2002
Delphi Programming Neil Moffatt 2002 - 2020. All rights reserved.  |  Home Page