Note
This function is available starting from V4.6.0.
Syntax
TO_DATE(string [, format])
Purpose
This function converts the string string to the DATE type in the specified format. If format is omitted, the default date format of the session is used.
Examples
obclient> SELECT TO_DATE('20260330', 'YYYY/MM/DD');
The execution result is as follows:
+-----------------------------------+
| TO_DATE('20260330', 'YYYY/MM/DD') |
+-----------------------------------+
| 2026-03-30 00:00:00 |
+-----------------------------------+
1 row in set
