How to convert date string to date in oracle?

Member

by denis , in category: MySQL , 10 months ago

How to convert date string to date in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by haylee.mertz , 10 months 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.

Related Threads:

How to convert string to date in react native with moment.js?
How can convert date format in oracle?
How to insert a string into oracle as a date type?
How to convert date to gmt format using oracle?
How to convert unix timestamp to local date in oracle?
How to cast date as date string in presto?