I need to choose the most recently modified file in my installation script. It seems the Pascal scripting language has no GetFileDateTime
or similar, so I am resorting to:
function FileDateTime (FileID : string) : double ;
var
FindRec : TFindRec;
begin
Result := 0.00 ;
if (FindFirst (FileID, FindRec)) then
begin
try
Result := FindRec.LastWriteTime ; { gives type mismatch, naturally }
finally
FindClose (FindRec) ;
end ;
end ;
end ;
but I can't find any documentation on the format of LastWriteTime
. Ideally I want the datetime returned in a format that will make it relatively easy to display it, as I will need to write the equivalent of Delphi's FormatDateTime
as well. Inno Pascal has GetDateTimeString
but this only formats the current datetime, not an arbitrary datetime.