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: How to use date mask 'dd-MON-rr'?

Re: How to use date mask 'dd-MON-rr'?

From: Arjan van Bentem <avbentem_at_DONT-YOU-DARE-cable.a2000.nl>
Date: Wed, 22 Jul 1998 18:10:40 +0200
Message-ID: <6p52tn$i2n$1@pascal.a2000.nl>


> last two digits of year for years in other centuries.
> Can anyone explain this statement to me in details with example, please?

RR rounds the century up one if the year is <50 and the last 2 digits of the current year are >=50, and down one century if the year is >=50 and the last 2 digits of the current year are <50. Today, 50 will be interpreted as 1950, 51 as 1951, 99 as 1999, 00 as 2000, 49 as 2049. In 2000, the same is true, until 2050. As of 2050, 49 will be interpreted as 2149, and 50-99 will be 2050 - 2099. So, there is a new problem in 2050 if users by then have not learned to enter 4 digits for the ear. On January 1st 2050 the users might expect that entering 49 yields 2049, just like it did one day earlier...

>What is the difference between YYYY and RR for input and output fields?

In output RR and YY are the same. RRRR and YYYY are the same as well. In input, RRRR accepts either 4-digit or 2-digit input. If 2-digit, rounds the century up one if the year is <50 and the last 2 digits of the current year are >=50, and down one century if the year is >=50 and the last 2 digits of the current year are <50. So, today entering 49 or 2049 is the same, as is entering 50 or 1950.

>And which one is better to beat the year 2K problem?

DD-MON-RRRR, while at the same time force your users to enter four digits for the year. When using YY, entering 98 will be interpreted as 1998 today, but as 2089 as of January 1st, 2000. And when using DD-MON-YYYY you will get the year 0098 if your users enter 98 instead of 1998! This is perfectly sensible, as entering 1 for the day is also interpreted as 01. This is nust the very same for years... So use RRRR, or at least RR.

Arjan. Received on Wed Jul 22 1998 - 11:10:40 CDT

Original text of this message

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