Difference Between 'YYYY' and 'RRRR'

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
Kashif
Posts: 137
Joined: Wed Apr 26, 2006 5:57 am
Location: Pakistan
Contact:

Difference Between 'YYYY' and 'RRRR'

Post by Kashif »

Dear All Memebrs.

We Use Formt Strings for Converting Charaters to Dates and Dates to Character. I want to Know the Technical Difference between both of them.
'DD-MON-RRRR' AND 'DD-MON-YYYY'

and also the Difference of FORMAT MASK Used in Developer 6i( in Both Cases)

Thnanks
ahmadbilal
Posts: 615
Joined: Mon Sep 18, 2006 1:32 am
Location: United Arab Emirates
Contact:

Post by ahmadbilal »

Dear Kashif,
Consider you have a date field in database at the time of insertion consider follwing

If NLS_DATE_FORMAT="DD-MON-YY"

10-JAN-1822 raises an error in Oracle7.
Inserts 10-JAN-1822 in Oracle8.
10-JAN-22 is inserted as 10-JAN-1922
10-JAN-95 is inserted as 10-JAN-1995

If NLS_DATE_FORMAT="DD-MON-YYYY"

10-JAN-1822 is inserted as 10-JAN-1822
10-JAN-22 is inserted as 10-JAN-0022
10-JAN-95 is inserted as 10-JAN-0095

If NLS_DATE_FORMAT="DD-MON-RRRR" (available in Oracle 7.2 onwards)

10-JAN-1822 is inserted as 10-JAN-1822
10-JAN-22 is inserted as 10-JAN-2022
10-JAN-95 is inserted as 10-JAN-1995

Note 'RRRR' takes 2 digit years <50 to be in the next century
and 2 digit years >=50 to be in this century. As we enter the
21st century RRRR behaviour will remain consistent so 10-JAN-95
will continue to mean 1995 until the year 2050.



Hope this will clear your Q
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests