Mega Code Archive

 
Categories / Delphi / Files
 

Capture the date and time stamp of a file

Title: Capture the date and time stamp of a file Question: How to realize the function GetFileTimestamp Answer: Capture the date and time stamp of a file function GetFileTimestamp(aFile: string): string; var Handle: integer; begin Result := ''; Handle := FileOpen(aFile, 0); try Result := DateTimeToStr(FileDateToDateTime(FileGetDate (Handle))); finally FileClose(Handle); end; end;