VBScript IsDate Function


Advertisements

It is a function that returns a Boolean Value whether or Not the given input is a date.

Syntax

IsDate(expression)

Example

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         document.write("Line 1 : " & IsDate("Nov 03, 1950") & "<br />")
         document.write("Line 2 : " & IsDate(#01/31/20#) & "<br />")
         document.write("Line 3 : " & IsDate(#05/31/20 10:30 PM#) & "<br />")

      </script>
   </body>
</html>

When you save it as .html and execute it in Internet Explorer, then the above script will produce the following result −

Line 1 : True
Line 2 : True
Line 3 : True 
vbscript_date.htm
Advertisements