mySQL date format is 'YYYY-MM-DD' (ISO Format).
Given your clarification that you cannot change the format of the incoming date, you need something like this:
var dateParts = isoFormatDateString.split("-"); var jsDate = new Date(dateParts, dateParts - 1, dateParts.substr(0,2));
Is there a reason you can't get a timestamp instead of the date string? This would be done by something like:
SELECT UNIX_TIMESTAMP(date) AS epoch_time FROM table;
var myDate = new Date(epoch_time * 1000);