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

Home -> Community -> Usenet -> c.d.o.server -> Re: Julian date from Oracle NNN.NN

Re: Julian date from Oracle NNN.NN

From: Martin Haltmayer <Martin.Haltmayer_at_0800-einwahl.de>
Date: 2000/06/18
Message-ID: <394CCDFF.6A40EC8@0800-einwahl.de>#1/1

No, the format SSSS will give you the seconds twice:

select to_char (sysdate, 'SSSS') from dual;

yields

TO_C



5757

What you want is

SQL> select sysdate - trunc (sysdate) from dual;

SYSDATE-TRUNC(SYSDATE)


             .64244213

Martin

ken k wrote:
>
> I think I asked this wrong.
>
> I can get the julian day I want by to_char(sysdate, 'DDD').
>
> I want to convert the current time to a fractional part of a day.
> So noon would be .5 and midnight would be .0
>
> I can get this with to_number(to_char(sysdate,'SSSS'))/84600
>
> I was just wondering if there is a better way to do it. I have very
> little luck with the Oracle documentation. It took me 2 days to find the
> formats for the to_char function.
>
> Maybe my question should be:
>
> Is there a better way to find things in the Oracle documentation?
>
> Ken K
>
> ken k <khkachn_at_toadDIESPAMMER.net> wrote in message
> news:_PV%4.1927$JC.4439298_at_news.abs.net...
> > What is the best way to get a REAL julian date out of an Oracle
> > date, ie: # of days in current year and fractional part for the
> > time.
> >
> > Thanks,
> >
> > Ken k
> >
> >
Received on Sun Jun 18 2000 - 00:00:00 CDT

Original text of this message

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