Name
IsDate Function
Syntax
IsDate(expression
)
expression
Use: Required
Data Type: Any.
Variable or expression containing a date or time.
Return Value
Boolean (True
or False
).
Description
Determines whether a variable’s value can be converted to a date.
Rules at a Glance
If the expression passed to IsDate is a
valid date, True
is returned;
otherwise, IsDate returns False
.
Programming Tips and Gotchas
IsDate uses the locale settings of the current Windows system to determine whether the value held within the variable is recognizable as a date. Therefore, what is a legal date format on one machine may fail on another.
IsDate is particularly useful for validating data input.
Get VBScript in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.