<script language="VBScript">
Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate = "Hello"
MyCheck = IsDate(MyDate)            ' ·&micro;&raquo;&Oslash; True&iexcl;&pound;
MyCheck = IsDate(YourDate)          ' ·&micro;&raquo;&Oslash; True&iexcl;&pound;
MyCheck = IsDate(NoDate)   
</script>

解决方案 »

  1.   

    <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>
      

  2.   

    <script>
    function isDate(xx)
    {
    x=new Date(xx)
    if(isNaN(x)) alert(xx+"不是日期")
    else
    alert(xx+"是有效日期")
    }
    isDate("12/31/2002")
    isDate("Hello")
    </script>