DIAdem Help

Method: IsDate for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: IsDate for VBS

Specifies whether an expression contains a valid date.

vIsDate = Object.IsDate(expression)
ObjectVBS
Object with this method. You do not need to specify this object.
expressionVariant
Specifies any expression.
vIsDateVariant
The IsDate method returns True if the expression contains a valid date. Otherwise the method returns False.

The following example checks whether a variable contains a valid date:

MyDate = "1/1/2011"
Call MsgBox(IsDate(MyDate))   ' Returns True
MyDate = #10/1/11#
Call MsgBox(IsDate(MyDate))   ' Returns True
MyDate = "No Date"
Call MsgBox(IsDate(MyDate))   ' Returns False
MyDate = "4711
Call MsgBox(IsDate(MyDate))   ' Returns False

See Also

Objects Overview

Related Topics

IsArray | IsDate | IsEmpty | IsNull | IsNumeric | IsObject | TypeName | VarType

Log in to get a better experience