function newdate(str) { str = str.split('-');
var date = new date();
date.setutcfullyear(str[0], str[1] - 1, str[2]);
date.setutchours(0, 0, 0, 0);
return date;
}
所以,为保证在各个浏览器中兼容,其实就是指为了兼容ie,我们在使用date()对象时最好统一使用new date(year, month, day, hour, minute, sec, millsec)
或
new date(millsec)(millsec为距1970年1月1 日至今的毫秒数).
在ie下 new date(date text) 时返回的成果是一个特别的日期对象,只是ie调试器将之显示成了nan, 对其调用返回number的办法将都邑返回nan
