Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Does the year 0 (BC/AD) exist? (Was: Get sysdate as number)
You're right - I should have chosen my words better:
the Georgian (I believe is the phrase) year 0 does not exist,
unless you use Julian date arithmatic:
Dec, 31st, 1BC would be day 1721057 , whereas day 1721424
would be Jan, 1st, 1 AD - according to our calendar, two
consecutive days: new years eve and new year.
However, there are 366 days inbetween those two dates, according
to the Julian calendar. So, the year 0 must exist, and have 366 days,
making it a leap year.
Comments are welcome.
David Fitzjarrell wrote:
> In our last gripping episode Frank van Bortel <fbortel_at_home.nl> wrote:
> > But be careful with the results: according to the Julian
> > calendar implementation in Oracle, the year 0 exists
> > (and is a leap year!)
> >
>
> Which version of Oracle? As I'm temporarily without an 8i instance I
> cannot check that, but on 7.3.4.4 and 8.0.5 the Julian year 0 does not
> exist:
>
> select to_date(0,'J')
> *
> ERROR at line 1:
> ORA-01854: julian date must be between 1 and 5373484
>
> > Mark D Powell wrote:
> >
> > > In article <3A09514E.1AD83BDE_at_capgemini.nl>,
> > > Patrick Diks <patrick.diks_at_capgemini.nl> wrote:
> > > > Hi,
> > > >
> > > > You need a reference date to count from ie:
> > > > SQL> select sysdate - to_date('01-01-1970','dd-mm-yyyy') from
dual;
> > > >
> > > > SYSDATE-TO_DATE('01-01-1970','DD-MM-YYYY')
> > > > ------------------------------------------
> > > > 11269,588
> > > >
> > > > The resulting number is the difference in days.
> > > >
> > > > HTH,
> > > >
> > > > Patrick Diks
> > > >
> > > > klausspeierl_at_my-deja.com wrote:
> > > > >
> > > > > I want to get the absoulute oracle time sysdate as a number.
> > > > > I tried
> > > > > select to_number(sysdate) from dual
> > > > >
> > > > > But I always got a error.
> > > > >
> > > > > Any ideas?
> > > > >
> > > > > Thanks in advance
> > > > >
> > > > > Klaus
> > > > >
> > > > > Sent via Deja.com http://www.deja.com/
> > > > > Before you buy.
> > > Patrick gave the response that I think Klaus can use, but since did
not
> > > specifiy what type of number or what he wanted it for he may want
the
> > > Oracle Julian date which you can get using:
> > >
> > > UT1> l
> > > 1* select to_char(sysdate,'J') "Julian" from sys.dual
> > > UT1> /
> > >
> > > Julian
> > > -------
> > > 2451857
> > >
> > > --
> > > Mark D. Powell -- The only advice that counts is the advice that
> > > you follow so follow your own advice --
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> > --
> > Gtrz,
> >
> > Frank van Bortel
> >
> >
>
> --
> David Fitzjarrell
> Oracle Certified DBA
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
-- Gtrz, Frank van BortelReceived on Fri Nov 10 2000 - 15:19:18 CST
![]() |
![]() |