function blah(dateString) {
[i][COLOR=grey]//change dashes to slashes in case date is being supplied from SQL[/color][/i]
dateString = dateString.replace(/-/g, "/");
[i][COLOR=grey]//convert the string to a date object[/color][/i]
var dateObj = new Date(dateString);
[i][COLOR=grey]//reconvert the date to a standard SQL format
//complete with handy-dandy leading 0's[/color][/i]
var newDateString = dateObj.getFullYear + "-" + ((dateObj.getMonth + 1 < 10) ? "0" + (dateObj.getMonth + 1) : dateObj.getMonth) + "-" + ((dateObj.getDate < 10) ? "0" + dateObj.getDate : dateObj.getDate);
return newDateString;
}