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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Difference between YYYY n RRRR date format

743195Jan 6 2010 — edited Jan 6 2010
Hi,
I am not clear with the difference between YYYY n RRRR format in case if we are passing 4 digits input.

As per my understanding:
RRRR accepts a four-digit input (although not required), and
converts two-digit dates as RR does. YYYY accepts 4-digit inputs but doesnt
do any date converting.

But if i do:
select to_date('06-JAN-1940 00:00:00','DD-MON-RRRR HH24:MI:SS') from dual;
or
select to_date('06-JAN-1940 00:00:00','DD-MON-YYYY HH24:MI:SS') from dual;

the output is same which is : 06/01/1940 00:00:00

Why not in RRRR case, it is onverting last 2 digits i.e 40 to 2040(Y2K-compliant format)?

according to me output with RRRR should be 06/01/2040 00:00:00.... Any comments?

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 3 2010
Added on Jan 6 2010
3 comments
27,202 views