title: Delphi - tfilestream: write time and date to file
body: <p>I am trying to save a line for each event containing a piece of text and the time + date when happened.</p>
  
  <p>The problem is:</p>
  
  <ol>
  <li>time is shown as Chinese font</li>
  <li>it replaces the same line over and over again</li>
  </ol>
  
  <p>Here is the code:</p>
  
  <pre><code>    uses sysUtils, classes;
  
  function log: Boolean;
  var
    fs: TFileStream;
    i : String;
    time : TDateTime;
  
  begin
    i := 'Boss is dead!';
    time := now;
    try
      fs := TFileStream.Create('log.txt', fmCreate or fmOpenWrite);
      fs.Write(PChar(i +TimeToStr(time))^, Length(i +TimeToStr(time)));
      fs.write(i, sizeof(i));   
    finally
      fs.Free; 
    end;
  
  end;
  </code></pre>
  
  <p>Thank you.</p>