Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cut Off Value for Y2K

Status
Not open for further replies.

asth01

Programmer
Jan 18, 2004
36
US
Hi,

How can I know what is the cutoff value in Oracle that determined if a date is in Century 19 or 20?

For Example,
If I specify 13-MAR-85, is it 1985 or 2085? Where this cutoff is specified?

Thanks in advance
 
Dates are stored with full year number, the error may occur when converting from char. In this case if not explicitly specified NLS_DATE_FORMAT parameter is used as a default format mask. For 2-digit year notation 'RR' and 'YY' formats are used. The first is evaluated as the year in current century while the second uses half-centuries:

SQL> alter session set nls_date_format='dd.mm.yyyy';
SQL> select to_date('01.01.49','dd.mm.rr') from dual;

TO_DATE('0
----------
01.01.2049
SQL> select to_date('01.01.49','dd.mm.yy') from dual;

TO_DATE('0
----------
01.01.2049
SQL> select to_date('01.01.50','dd.mm.rr') from dual;

TO_DATE('0
----------
01.01.1950
SQL> select to_date('01.01.50','dd.mm.yy') from dual;

TO_DATE('0
----------
01.01.2050

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top