Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date conversion from string to date format

LRAJESHJul 12 2011 — edited Jul 14 2011
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

Here is the example:--

select to_date('2007-01-01 12:00:01 AM','yyyy-mm-dd hh:mi:ss pm') as dt from dual;

DT
--------------------------------------------------------------------------------
01-JAN-07

But for me the required out as date format is '01-JAN-2007'


When i pass as string '01-01-1930' as above conversion it is returning as '01-01-2030'.
Anyone please help me on this.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2011
Added on Jul 12 2011
11 comments
1,511 views