Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 7.2 Year2000 & Medium dates
Hello, Mike.
Mike Desson <mdesson_at_internetwis.com> escreveu no artigo
<01bcdbde$5bd5eb60$4ad7e6ce_at_993110h>...
> Can anyone provide a detailed solution on how to set Oracle7.2 properly
to
> have dates entered in medium date format (01-Oct-20) interpretted as
> 01-October-2020 instead of 01-October-1920.
>
You can add the line "NLS_DATE_FORMAT=DD-MON-RR" or "NLS_DATE_FORMAT=DD-MON-RRRR" to your envorinment, so Oracle will act just like if the century started in 01-JAN-1950 and finished in 31-DEC-2049.
> We have been told to add a line to config.ora NLS_DATE_FORMAT=DD-MON-RR
> and that the maximum date is 01-jan-37 (2037).
>
> Then we heard that the statement was NLS_DATE_FORMAT=DD-MON-RRRR and the
> maximum date is 31-Dec-36.
Nonsense !!! Try yourself in a SQL*Plus session. After logging in, type ALTER SESSION SET NLS_DATE_FORMAT = DD-MON-RRRR. Then try SELECT SYSDATE FROM DUAL. If you want, use the script below:
CREATE TABLE TEST
(test_time date, what_i_want varchar2(50)); ALTER SESSION SET NLS_DATE_FORMAT = DD-MON-RR; INSERT INTO TEST -- value: 01-jan-1950 VALUES('01-JAN-50', 'It would be 01-jan-1950'); INSERT INTO TEST -- value: today VALUES(sysdate, 'Well, it's today'); INSERT INTO TEST -- value: 01-jan-1999 VALUES('01-JAN-99', 'It would be 01-jan-1999'); INSERT INTO TEST -- value: 31-dec-1999 VALUES('31-DEC-99', 'It would be 31-dec-1999'); INSERT INTO TEST -- value: 01-jan-2000 VALUES('01-JAN-00', 'It would be 01-jan-2000'); INSERT INTO TEST -- value: 31-dec-2000 VALUES('31-DEC-00', 'It would be 31-dec-2000'); INSERT INTO TEST -- value: 01-jan-2001 VALUES('01-JAN-01', 'It would be 01-jan-2001'); INSERT INTO TEST -- value: 01-jan-2049 VALUES('01-JAN-49', 'It would be 01-jan-2049'); INSERT INTO TEST -- value: 31-dec-2049 VALUES('31-DEC-49', 'It would be 01-dec-2049');COMMIT;
FROM TEST; Do not forget to drop table TEST after you're done!
-- DANILO GIMENEZ danilog_at_mandic.com.br Sao Paulo - SP - BrasilReceived on Mon Oct 20 1997 - 00:00:00 CDT
![]() |
![]() |