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

Home -> Community -> Usenet -> c.d.o.misc -> The year zero in date functions

The year zero in date functions

From: <v0139992_at_gepex.ge.com>
Date: Thu, 17 Sep 1998 11:06:54 GMT
Message-ID: <6tqqgd$k3t$1@nnrp1.dejanews.com>


Hi,

I have a question about the year zero in Oracle.

If I enter select to_date('0000-01-01','yyyy-mm-dd') from dual I get ORA-01841: (full) year must be between -4713 and +9999, and not be 0 Thate off course means that the year zero is not a valid year. In itself the first day of the first year after the birth of Christ can be 1 jan 0001 and the day before 31 dec -0001.

The bad thing is that if I enter a julian date of 1721057 I get 31 dec -0001. Using 1721058 gets me an error message of ORA-01841: (full) year must be between -4713 and +9999, and not be 0. Same thing for 1721423.
1721424 gives 1 jan 0001.
This leaves a gap of 366 days ( year 0000 should be a leap year) in the julian calendar.

I understand it is not a big thing, but it can cause errors in subtracting dates going a long way back.

If there is a solution, I would like to know.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Sep 17 1998 - 06:06:54 CDT

Original text of this message

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