Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date format RR limitations. (adding; Please answer, Thomas Kyte!)

Re: Date format RR limitations. (adding; Please answer, Thomas Kyte!)

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 04 Mar 1999 05:06:47 GMT
Message-ID: <36e31451.6490002@192.86.155.100>


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,'



01-jan-0099

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,'



01-jan-1999

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  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Mar 03 1999 - 23:06:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US