title: Getting the last modification date of a file in Inno Setup Pascal Script
body: <p>I need to choose the most recently modified file in my installation script.  It seems the Pascal scripting language has no <code>GetFileDateTime</code> or similar, so I am resorting to:</p>
  
  <pre class="lang-pascal prettyprint-override"><code>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 ;
  </code></pre>
  
  <p>but I can't find any documentation on the format of <code>LastWriteTime</code>.  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 <code>FormatDateTime</code> as well.  Inno Pascal has <code>GetDateTimeString</code> but this only formats the current datetime, not an arbitrary datetime.</p>