PL/SQL To_Date

Oracle PL/SQL To_Date Function

The To_Date function converts a string to a date.

The To_Date Function syntax:

to_date( string, [ format_mask ], [ nls_language ] )

Example

select to_date('2008/08/21', 'yyyy/mm/dd') from dual; 

8/21/2008


select to_date('082111', 'MMDDYY') from dual;

8/21/2011


select to_date(sysdate, 'dd-mm-yyyy') from dual;

10/11/2010


select to_date('20090717', 'yyyymmdd') from dual;

7/17/2009