title: Sqlite timestamp to javascript Date object
body: <p>I'm trying to import an old sqlite database to mongodb using node, this db has several date fields and I can't get the correct data, for example:</p>
  
  <p>370735200 -> Should be <strong>2012/10/01 00:00:00</strong> but it shows:</p>
  
  <blockquote>
    <p>Wed Sep 30 1981 23:00:00 GMT+0100 (CEST)</p>
  </blockquote>
  
  <p>I'm doing this:</p>
  
  <pre><code>   var originalDate = Math.round (new Date(data.origDate * 1000))
  </code></pre>
  
  <p>Another example 360540000 -> Should be <strong>2012/06/05 00:00:00</strong> but it shows:</p>
  
  <blockquote>
    <p>Fri Jun 05 1981 00:00:00 GMT+0200 (CEST)</p>
  </blockquote>
  
  <p>The date fields in SQLite db have the type: <strong>timestamp</strong></p>
  
  <p>Maybe somebody could advise or suggest some node module to deal with this.</p>
  
  <p>Edited, adding info:</p>
  
  <p>I was told that the sqlite value comes from NSDate, I saw the docs:The sole primitive method of NSDate, "timeIntervalSinceReferenceDate, provides the basis for all the other methods in the NSDate interface. This method returns a time value relative to an absolute reference date—the first instant of 1 January 2001, GMT." But I still wonder how can I translate that to get the correct date.</p>