Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

VBScript IsDate Function

Returns a Boolean value indicating whether an expression can be converted to a date.

Syntax: VBScript IsDate Function

IsDate(expression)

Arguments: VBScript IsDate Function

expression

Any date expression or string expression recognizable as a date or time.

Remarks: VBScript IsDate Function

IsDate returns True if the expression is a date or can be converted to a valid date; otherwise, it returns False. In Microsoft Windows, the range of valid dates is January 1, 100 AD through December 31, 9999 AD; the ranges vary among operating systems.

The following example uses the IsDate function to determine whether an expression can be converted to a date:

Dim MyDate, YourDate, NoDate, MyCheck

MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate = "Hello"

MyCheck = IsDate(MyDate)   ' Returns True.

MyCheck = IsDate(YourDate)   ' Returns True.

MyCheck = IsDate(NoDate)   ' Returns False.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.