第一种
function compareDate(s1,s2){
return ((new Date(s1.replace(/-/g,"\/")))>(new Date(s2.replace(/-/g,"\/"))));
}
第二种
var curTime = new Date();
//把字符串格式转化为日期类
var starttime = new Date(Date.parse(begintime));
var endtime = new Date(Date.pares(endtime));
//进行比较
return (curTime>=starttime && cutTime<=endtime);
1. 日期无穷大
2.日期无穷小