Re: 2000 AD - Oracle Date Format

From: Thomas J Kyte <tkyte_at_us.oracle.com>
Date: 1996/03/23
Message-ID: <4j15uj$626_at_inet-nntp-gw-1.us.oracle.com>#1/1


Charles Wolfe <cwolfe_at_ix.netcom.com> wrote:

>Erik Lindquist <elindquist_at_logicon.com> wrote:
>>Just wondering... Currently the default date format for Oracle is
>>DD-MON-YY. What will happen in the year 2000 if I query the database
>>like this:
>>
>>SELECT...
>>FROM ...
>>WHERE DATE_COLUMN = '22-MAR-96'
>>
>>Is this date going to evaluate to the year 1996 or 2096?
>>
>>Anyone know? Thanks.
>>
>>-Erik. elindquist_at_logicon.com

>Erik,
 

>Oracle stores the DATE datatype internally in fixed-length 7 byte fields
>corresponding to century, year, month, day, hour, minute, second. The
>'DD-MON-YY' format is the default input/output format for dates.
 

>If you use the default format for input/output then, 'YY' indicates the
>year in the 20th century and 22-MAR-96 is March 22, 1996.

Not really, YY indicates the year in the *current* century and if executed in the year 2000 will return March 22, 2096 (Oracle assumes the 21'st century begins in the year 2000). If you use the RR date format, it will return March 22, 1996.

>Hope this helps.
 

>regards,
>Chuck
>--
>********************************************************************
>Chuck Wolfe Phone: (703)325-3718
>Senior Consultant E-mail: cwolfe_at_ix.netcom.com
>TELOS Consulting Services
>460 Herndon Parkway
>Herndon, VA 22070
 

>Reach out and grep someone...
 

>********************************************************************

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government



opinions and statements are mine and do not necessarily reflect the opinions of Oracle Corporation. Received on Sat Mar 23 1996 - 00:00:00 CET

Original text of this message