Skip to content

Oracle Convert String to Date

Here are some examples of Oracle SQL queries to convert string to date.

Oracle to_date() Function Examples to Convert String to Date

To convert a string to date, you will have to follow the same date format in which your string is. The following are the examples:

select to_date('31jan2021', 'ddmonyyyy') from dual;

Output:

01/31/2021
select to_date('20210131', 'yyyymmdd') from dual;

Output:

01/31/2021

Converting strings having date and time:

select to_date('20210131141055', 'yyyymmddhh24miss') from dual;

Output

01/31/2021