By default date.toISOString returns UTC time instead of local time. So you'll need to calculate the timezone offset first.
//Get the local date in ISO format
var date = new Date();
date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
var datestr = date.toISOString().substring(0, 10);