title: How to convert a unix timestamp to a Date in TypeScript?
body: <p>In plain JavaScript and TypeScript we can write the following to obtain the unix timestamp of a Date:</p>
  
  <pre><code>let d = new Date();
  const unixtime = d.valueOf();
  </code></pre>
  
  <p>Now, in JavaScript, we can easily convert that unix timestamp back to a Date:</p>
  
  <pre><code>d = new Date(unixtime);
  </code></pre>
  
  <p>However, in TypeScript, the above returns an error message:</p>
  
  <blockquote>
    <p>error TS2554: Expected 0 arguments, but got 1.</p>
  </blockquote>
  
  <p>So how can I convert a unix timestamp to a date in TypeScript? I'm using ES6 library</p>