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
new Date(new Date(YOUR_DATE.toISOString()).getTime() - (YOUR_DATE.getTimezoneOffset() * 60 * 1000)).toISOString().substr(0, 10)