forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
7.8 KiB
7.8 KiB
isdate
This function is used to determine whether a date string can be converted into a date value based on a specified format.
Syntax
isdate(string date , string format)
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
date |
Yes |
DATE or STRING |
String to be checked If the value is of the BIGINT, DOUBLE, DECIMAL, or DATETIME type, the value is implicitly converted to the STRING type for calculation. The value can be any string. |
format |
Yes |
STRING |
Format of the date to be converted Constant of the STRING type. Extended date formats are not supported. The value is a combination of the time unit (year, month, day, hour, minute, and second) and any character.
|
Return Values
The return value is of the BOOLEAN type.
Example Code
The value true is returned.
select isdate('2023-08-10','yyyy-mm-dd');
The value false is returned.
select isdate(123456789,'yyyy-mm-dd');
Parent topic: Date Functions