Skip to content

TO_DATE

  • string: This is the input parameter, a character literal representing a date and time. It directly inputs the actual date, time, and year that is needed to be converted.
  • format: This parameter defines the format of the string parameter. It specifies the expected date, time, and year format of the string. The format option allows for variability in the input based on a defined pattern.
SELECT TO_DATE('22-AUG-2020', 'DD-MON-YYYY') AS "Converted_Date" FROM dual;
Converted_Date
--------------
2020-08-22

The TO_DATE function in Oracle converts a string value to a DATE value according to the format model specified. The example converts the string ‘22-AUG-2020’ to a DATE value in ‘YYYY-MM-DD’ format.