Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date Question
Anurag Varma wrote:
> I don't think he is referring to the year zero problem.
> He seems to be getting the following date when using sqlplus:
> 00-00-0000 00 00:00:00
>
Yes, that is the problem to which I was referring. In fact, using this version of SQLPLUS, I get the same date for any day that would be in Oracle year 0.
SQL> select to_char(trunc(sysdate)-732392, 'dd-mon-yyyy AD') from dual;
TO_CHAR(TRUNC(
SQL> select to_char(trunc(sysdate)-732393, 'dd-mon-yyyy AD') from dual;
TO_CHAR(TRUNC(
SQL>
> while he gets the right date back when using pl/sql.
>
> I for one am not able to reproduce this issue in 9.2.0.6.
>
> ORA92> select to_char((trunc(sysdate)-732757),'DD-MM-YYYY AD
> HH24:MI:SS')
> from dual; 2
>
> TO_CHAR((TRUNC(SYSDATE)-732757
> ---------------------------------------------------------------------------
> 02-01-0000 AD 00:00:00
>
>
> Maybe its a bug .. and requires a patch.
>
> Anurag
Received on Tue Mar 21 2006 - 15:57:15 CST