isDate()
Table of Contents
Overview
The isDate() function takes an expression as an argument, and returns true if it is a valid date-time value. Otherwise, it returns false.
Return Type
- BOOLEAN
Syntax
<variable> = isDate( <expression> );
(or)<variable> = <expression>.isDate();
Parameter | Data type | Description |
---|---|---|
<variable> | BOOLEAN | Variable which will contain the returned boolean value. |
<expression> | - | The expression which needs to be checked. Text values containing a valid date-time value will return true, and which do not contain a valid date-time value will throw an error. List and key-value data type will return a null value. |
Examples
dateString= "01-Jan-2019"; dateValue= '01-Jun-2020'; numValue= 100 ; boolValOne = isDate(dateString); //returns true boolValTwo = isDate(numValue); // returns false boolValThree = dateValue.isDate(); // returns true