The date field in my mongodb database is saved under the following format
"$date": "2012-01-05T19:47:56.474Z"
But somehow mongoose returns it as
date: Wed, 04 Jan 2012 19:14:33 GMT
Why does the format change, is it something i am doing in the query ?
That’s the way a standard JavaScript Date object is formatted when printing.
You can print it out in ISO format using something like this:
How do I output an ISO 8601 formatted string in JavaScript?
Or you might try using a javascript date library for formatting such as:
http://arshaw.com/xdate/#Formatting