Description:
Returns a Boolean value - specifies whether an expression can be converted to a date.
In the PROMOTIC system it is better to use Pm.IsValid(Pm.ToNumber(expression))
or
Pm.GetVarType (in the
JavaScript language, the
Date data type does not exist, therefore the
Double data type is used unstead).
Syntax:
Boolean IsDate(Variant expression)
Parameters:
expression | (Variant) Date or text string that represents a date or time |
---|
Return value:
true - If the expression is a date or if can be converted to a valid date
false - Otherwise
Note:
The range of valid dates is from January 1, 100 A.D. to December 31, 9999 A.D. in Windows OS The range vary among operating systems.
Example:
VBScriptSelect and copy to clipboard
Dim MyDate, YourDate, NoDate, bCheck
MyDate = "October 19, 2024"
YourDate = #10/19/17#
NoDate = "Hello"
bCheck = IsDate(MyDate)
' Returns true
bCheck = IsDate(YourDate)
' Returns true
bCheck = IsDate(NoDate)
' Returns false