YouTip LogoYouTip

Func Isdate

VBScript IsDate Function

VBScript IsDate Function

- Learn to Code, Build Career!

VBScript IsDate Function

The IsDate function returns a Boolean value indicating whether an expression can be converted to a date. If the expression is a date or can be converted to a date, it returns True. Otherwise, it returns False.

Note: The IsDate function uses local settings to detect if a string can be converted to a date (in all languages, "January" is not a month).

Syntax

IsDate(expression)
Parameter Description
expression Required. The expression to calculate.

Example 1

Valid Date:

document.write(IsDate("April 22, 1947")) document.write("
") document.write(IsDate(#01/31/10#))

Output Result:

True
True

Try It Yourself Β»

Example 2

Invalid Date:

document.write(IsDate("#01/31/10#")) document.write("
") document.write(IsDate("52/17/2010")) document.write("
") document.write(IsDate("Hello World!"))

Output Result:

False
False
False

Try It Yourself Β»

More Information

Complete VBScript Reference Manual

Β© 2023 . All rights reserved.

← Func MinuteFunc Hour β†’