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

Home -> Community -> Usenet -> c.d.o.server -> Re: Y2K problem in NT4.0.

Re: Y2K problem in NT4.0.

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 26 May 1998 13:52:03 GMT
Message-ID: <356bc7d3.5503103@192.86.155.100>


A copy of this was sent to " Yeung Man" <yngm_at_chowsangsang.com> (if that email address didn't require changing) On Mon, 25 May 1998 15:15:34 +0800, you wrote:

>Hi,
>
> In our company, we use oracle 7.3.4 ent. for WinNT 4.0 server. We want
>to change NLS_DATE_FORMAT to 'DD-MON-RR'. I have add the entry
> NLS_DATE_FORMAT="DD-MON-YY" and add values NLS_DATe_FORMAT=DD-MON-RR in
>the register of NT server. Howerver, if we issue
> 'select to_char(to_date('1-may-98', 'dd-mon-yy'), 'dd-mon-yyyy') from
>dual;' we get '01-may-2098' not '01-may-1998'. The sysdate of the database
>is '25-may-2010'. Do I miss to do something? Please help! Furthermore, I
>have update my version from 7.3.2 to 7.3.4 however, the NLS_RDBMS_VERSION in
>table NLS_DATABASE_PARAMETER only shows 7.3.2.2.0 not 7.3.4 although I set
>the compatible to 7.3.4 in the init file, do I need to set any parameter?
>Please help!
>

If I understand, you have set your system clock to 2010. Since you are using explicit to_date/to_char format masks, the setting of the NLS_DATE_FORMAT is not relevant (that is used for implicit conversions without masks).

So, in the year 2010, you issue first:

   to_date('1-may-98', 'dd-mon-yy')

the yy format always assumes the date is in the current century so this is really May 1'st, 2098 since it is 2010. Then you turn it into a character string using:    

   to_char( date_field, 'dd-mon-yyyy' )

and that correctly prints 01-May-2098

If you have DD-MON-RR in your registry and that is the NLS_DATE_FORMAT then the result of

    select to_char( to_date( '01-may-98' ), 'dd-mon-yyyy' ) from dual;

in the year 2010 should be 01-May-1998.

> TIA.
>
>Best Regards,
>Man Yeung
>
>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue May 26 1998 - 08:52:03 CDT

Original text of this message

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