Skip to main content



IsDate Function

The IsDate function determines if an expression is a valid Date (or a DateTime with a zero time offset).

Syntax

IsDate(expression)

The IsDate function determines if an expression is a valid Date (or a DateTime with a zero time offset).

Arguments

expression Expression - string expression to check.

Remarks

  • Use the IsDateTime function to determine if an expression is a valid DateTime.

Example:

IsDate("12/31/2005"); // returns true

Example:

IsDate("2005-12-31"); // returns true

Example:

IsDate("2005-12-31Z"); // returns true

Example:

IsDate("2005-12-31T00:00:00Z"); // returns true

Example:

IsDate("12/31/2005 6:00:00 PM"); // returns false

Example:

IsDate("2005-12-31T18:00:00"); // returns false

Example:

IsDate("2005-12-31T18:00:00Z"); // returns false

Example:

IsDate("2013-13-40"); // returns false

Example:

IsDate("3:00pm"); // returns false