<script language="VBScript">
function compareDates (str1, str2)
if CDate(str1) < CDate(str2) then
compareDates = -1
else
if CDate(str1) = CDate(str2) then
compareDates = 0
else
compareDates = 1
end if
end if
end function
</script><input type="text" id="t1" value=""><input type="text" id="t2" value=""><input type="button" value="比较" onclick="alert(compareDates(t1.value, t2.value))">
function compareDates (str1, str2)
if CDate(str1) < CDate(str2) then
compareDates = -1
else
if CDate(str1) = CDate(str2) then
compareDates = 0
else
compareDates = 1
end if
end if
end function
</script><input type="text" id="t1" value=""><input type="text" id="t2" value=""><input type="button" value="比较" onclick="alert(compareDates(t1.value, t2.value))">
aa = new Date("2005","03","20","11","12","11");
bb = new Date("2005","03","20","11","12","11");
alert(aa>bb);
</script>