Difference Between to_char and to_date with example

(Last Updated On: August 11, 2016)

to_char:
to_char converts a date to string.

Query:
Select to_char(sysdate) from dual;
Output:
25-NOV-13

Query:
Select to_char(sysdate,’DD-MM-YYYY’) from dual;
Output:
25-11-2013

to_date:
to_date converts a string to date.

Query:
Select to_date(sysdate) from dual;
Output:
25-NOV-13

Query:
Select to_date(sysdate,’DD-MM-YYYY’) from dual;
Output:
25-NOV-13

276 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *