How to convert date string to date in oracle?

Member

by denis , in category: MySQL , a month ago

How to convert date string to date in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by haylee.mertz , 25 days ago

@denis 

You can convert a date string to a date data type in Oracle using the TO_DATE function.


Syntax: TO_DATE(date_string, format_mask)


Example: SELECT TO_DATE('2021-10-15', 'YYYY-MM-DD') AS converted_date FROM dual;


This will convert the date string '2021-10-15' to a date data type in Oracle.