This recent post made me investigate Julian to Oracle date conversions, and I came across what, in my opinion, is a bug in Oracle 11.1. Test examples:
Case 1
SELECT TO_CHAR(TO_TIMESTAMP('0', 'J'), 'DD MON SYYYY') FROM DUAL
This should return "01 JAN -4713" as defined here , but instead causes an error
ORA-01854: julian date must be between 1 and 5373484
Case 2
SELECT TO_CHAR(TO_TIMESTAMP('1', 'J'), 'DD MON SYYYY') FROM DUAL
This should return β02 ββJAN -4713β as an extension of the above (one day later than Julian zero date), but instead returns β01 JAN -4712β (shutdown a day less than a year).
Case 3
SELECT TO_CHAR(TO_TIMESTAMP('1721424', 'J'), 'DD MON SYYYY') FROM DUAL
"01 JAN 0001". ( ). 1 , , , 31 DEC -0001 ( ); ,
SELECT TO_CHAR(TO_TIMESTAMP('1721423', 'J'), 'DD MON SYYYY') FROM DUAL
:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
, Oracle .
( , TO_TIMESTAMP , TO_DATE).
- ,
.
, 11.2.
Cthulhu fhtagn.
10.2.0.4