how to convert this
Sun Jan 08 2012 00:00:00 GMT+0530 (Sri Lanka Standard Time)
into
2012-01-08
with javascript?
Regards
Edit:
i was actually working with extjs and didn’t know there is a built in way to do this with extjs
so i manage to do this
var date = new Date("Sun Jan 08 2012 00:00:00 GMT+0530 (Sri Lanka Standard Time)");
console.log(Ext.Date.format(date, 'Y-m-d'));
which gives me 2012-01-08
To date contructor you can pass a date string 🙂