var a=new Date('2003/03/03'); var b=new Date('2003/04/05'); if(Date.parse(a)<Date.parse(b))alert("a<b") else(alert(a>=b))
<SCRIPT LANGUAGE=vbscript> <!-- function datevalid datevalid = false if not isdate(InputForm.date1.value) then msgbox "日期错误" exit function end if if not isdate(InputForm.date2.value) then msgbox "日期错误" exit function end if
if cdate(InputForm.date2.value) <= cdate(InputForm.date1.value) then msgbox "结束日期必须大于开始日期" exit function end if datevalid=true end function --> </script>
var b=new Date('2003/04/05');
if(Date.parse(a)<Date.parse(b))alert("a<b")
else(alert(a>=b))
<!--
function datevalid
datevalid = false
if not isdate(InputForm.date1.value) then
msgbox "日期错误"
exit function
end if if not isdate(InputForm.date2.value) then
msgbox "日期错误"
exit function
end if
if cdate(InputForm.date2.value) <= cdate(InputForm.date1.value) then
msgbox "结束日期必须大于开始日期"
exit function
end if
datevalid=true
end function
-->
</script>