I\'m trying to use javascript to convert a date object into a valid mysql date - what is the best way to do this?
function js2Sql(cDate) { return cDate.getFullYear() + '-' + ("0" + (cDate.getMonth()+1)).slice(-2) + '-' + ("0" + cDate.getDate()).slice(-2); }