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.
If the value of date or format is NULL, NULL is returned.
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');
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot