Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Y2K question
Dave,
Yes there is a problem, because the function TO_DATE converts the datatype VARCHAR2 to the datatype DATE, using the specified format (mm/dd/yy). In the TO_DATE conversion, Oracle uses by default the century at the time the conversion is being executed.
Executed at VARCHAR2 -> TO_DATE -> DATE
25-02-1998 01/01/99 -> -> 01/01/1999 25-02-1998 01/01/25 -> -> 01/01/1925 (!) 25-02-1998 01/01/00 -> -> 01/01/1900 (!) Executed at VARCHAR2 -> TO_DATE -> DATE 25-02-2002 01/01/99 -> -> 01/01/2099 (!) 25-02-2002 01/01/25 -> -> 01/01/2025 25-02-2002 01/01/00 -> -> 01/01/2000
The problems above can be fixed by using the RR format in DD/MM/RR but unfortunaly this is only possible in Forms 4.0/4.5.
I think you can understand the problem and impact a little better..
Harco de Jager
Jagerh_at_Vertis.nl
Dave Morse wrote:
> I recently read a quote in a publication that said:
>
> "And then, of course, there is the dreaded Year 2000 problem in Oracle. If
> your code contains lines like this: v_mydate := TO_DATE(v_mystr,
> 'mm/dd/yy'); -- then you have some big problems coming down the pike."
>
> Do you agree? The TO_DATE function converts strings to the default system
> date. In the above example, the 'mm/dd/yy' is simply telling Oracle what
> format the string 'v_mystr' is in, not what to convert it to.
>
> --
>
> Dave
> dmorse_at_cinergy.com (** please remove the 'nospam' from the address **)
Received on Wed Aug 05 1998 - 06:44:44 CDT
![]() |
![]() |