Updated on 2026-11-06 GMT+08:00

isdate

The isdate function is used to determine whether a date string can be converted to a date value according to the specified format.

Syntax

isdate(string date , string format)

Parameters

Table 1 Parameter descriptions

Parameter

Mandatory

Type

Description

date

Yes

DATE

or

STRING

The string to be evaluated.

If the input is of type BIGINT, DOUBLE, DECIMAL, or DATETIME, it is implicitly converted to STRING type before computation.

The date parameter can be in any string format.

format

Yes

STRING

The target date format for conversion.

A STRING type constant. Extended date formats are not supported.

The format is a combination of time units representing year, month, day, hour, minute, and second, along with any characters.

  • yyyy indicates year.
  • mm indicates month.
  • dd indicates day.
  • hh indicates hour.
  • mi indicates minute.
  • ss indicates second.

Return Values

Returns a value of type BOOLEAN.

If the date or format value is NULL, NULL is returned.

Example Code

Returns true.

 select isdate('2023-08-10','yyyy-mm-dd');

Returns false.

 select isdate(123456789,'yyyy-mm-dd');