I\'m trying to change the format of the dates I\'m getting from my Mongo database. Currently they look like this:
Fri Sep 16 2011 19:05:17 GMT+0900 (JST)
A modern way to do this is to use momentjs, both usable in node and in the browser, super useful and simple to use. For the current problem I solved it like this in node after following all the docs requirements :
var moment = require('moment');
var fomatted_date = moment(photo.date_published).format('YYYY-MM-DD');
with photo.date_published
directly coming from mongoose.