I have a date with the format Sun May 11,2014. How can I convert it to 2014-05-11 using JavaScript?
Sun May 11,2014
2014-05-11
Simply use this:
var date = new Date('1970-01-01'); // Or your date here console.log((date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear());
Simple and sweet ;)