function dateToSecond(dstr){ var dArr = dstr.match(/\d+/g); var date = new Date(); date.setYear(dArr[0]); date.setMonth(dArr[1] - 1); date.setDate(dArr[2]); return date.getTime();}