function compareTime()
{
var sDate=form1.kssj.value;
var eDate=form1.jssj.value;
var startDate = new Date(sDate.replace("-",",")).getTime() ;
var endDate = new Date(eDate.replace("-",",")).getTime() ;
if( startDate > endDate )
{
alert("开始时间不能大于结束时间!");
return false;
}
return true;
}
注:
sDate为开始时间
eDate为结束时间