How do I convert a Firestore date/Timestamp to a JS Date()? : <p>I am trying to convert the below date to a javascript Date() object. When I get it back from the server, it is a Timestamp object, </p>

<p><strong>Screenshot from Firebase Firestore console:</strong></p>

<p><a href="https://i.stack.imgur.com/Dz7gE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Dz7gE.png" alt="enter image description here"></a></p>

<p>When I try the following on a list of objects returned from firestore:</p>

<pre><code>  list.forEach(a =&gt; {
    var d = a.record.dateCreated;
    console.log(d, new Date(d), Date(d))
  })
</code></pre>

<p><strong>I get this output:</strong>
<a href="https://i.stack.imgur.com/H5NEW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H5NEW.png" alt="enter image description here"></a></p>

<p>Clearly the Timestamps are all different, and are not all the same date of Sept 09, 2018 (which happens to be today). I'm also not sure why <code>new Date(Timestamp)</code> results in an <code>invalid date</code>. I'm a bit of a JS newbie, am I doing something wrong with the dates or timestamps?</p>
