<script language="VBScript">
Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate = "Hello"
MyCheck = IsDate(MyDate) ' ·µ»Ø True¡£
MyCheck = IsDate(YourDate) ' ·µ»Ø True¡£
MyCheck = IsDate(NoDate)
</script>
Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate = "Hello"
MyCheck = IsDate(MyDate) ' ·µ»Ø True¡£
MyCheck = IsDate(YourDate) ' ·µ»Ø True¡£
MyCheck = IsDate(NoDate)
</script>
Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate = "Hello"
MyCheck = IsDate(MyDate) ' 返回 True。
MyCheck = IsDate(YourDate) ' 返回 True。
MyCheck = IsDate(NoDate)
</script>
function isDate(xx)
{
x=new Date(xx)
if(isNaN(x)) alert(xx+"不是日期")
else
alert(xx+"是有效日期")
}
isDate("12/31/2002")
isDate("Hello")
</script>