Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date format RR limitations. (adding; Please answer, Thomas Kyte!)
A copy of this was sent to "dhmac" <dhmac_at_JUSTREMOVETHISmy-dejanews.com>
(if that email address didn't require changing)
On Wed, 3 Mar 1999 23:10:04 -0500, you wrote:
>Arjan van Bentem wrote in message <36dcd363$0$13308_at_pascal>...
>[...]
>>
>>See above. It does *not* matter. Oracle always stores the dates fully Y2k
>>compliant (and has done since a long time), regardless whether it is in the
>>14th or 22nd century. It just is inputting two-digits years that gives you the
>>problem. Using RR, or even better RRRR for the input mask just helps you to
>>get the dates into the database. However, it is really a nice add-on to help
>>make your apps Y2k compliant. New apps should definitly use YYYY.
>>
>I know how RRRR works, but how does YYYY handle 2-digit years?
>
>
SQL> insert into t values ( to_date( '01-jan-99', 'dd-mon-yyyy' ) ) 2 /
1 row created.
SQL> select to_char( d, 'dd-mon-yyyy' ) from t;
TO_CHAR(D,'
SQL> delete from t;
1 row deleted.
SQL> insert into t values ( to_date( '01-jan-99', 'dd-mon-rrrr' ) ) 2 /
1 row created.
SQL> select to_char( d, 'dd-mon-yyyy' ) from t;
TO_CHAR(D,'
SQL> yyyy lpads with zeroes. rrrr does the century (50 year sliding window around century -- 01 would be 2001, 99 is 1999).
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities