Search code examples
node.jsmongodbmongoskin

NodeJS + MongoSkin + Timestamps


There's a handful of posts on inserting timestamps into Mongodb via MongoSkin, but nothing on the return end (other than pulling date from ObjectID).

After running findOne (which includes a MongoDate field), console-log reads the data field as ISO date, but is there an internal function that pulls the ->sec / timestamp.


Solution

  • The answer is: new Date( response.Date ).getTime()