node.js - Mongoose converting stored UTC dates to local time? -


i'm wondering if normal, or if i'm missing in schema setup or query process:

my app, , mongoose, correctly storing date utc in mongodb. confirmed viewing documents via mongo shell. when retrieve documents mongodb via mongoose date local time.

mongo shell: http://cl.ly/image/2m3p212o0i2x

console.log output of query results: http://cl.ly/image/3w2q3b1r0f3q

is there way have mongoose keep date utc when queried?

mongoose , node.js aren't doing dates, it's javascript date type produces local time string when call tostring() on though contains time in utc.

explicitly call toutcstring() on date object if want utc time string.


Comments