var date1=new Date(dateTimes[z][1]);
The time can be obtained normally under Firefox, but it is NaN under IE7. After struggling for a long time, I gave up on new date and then found a piece of code in a foreigner's forum that could be compatible with the formatted date code of all browsers:
function NewDate(str) {
str = str.split('-');
var date = new Date();
date.setUTCFulYear(str[0], str[1] - 1, str[2]);
date.setUTCHours(0, 0, 0, 0);
return date;
}