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 -> Re: plsql / function / convert to date

Re: plsql / function / convert to date

From: Oliver Demus <oliver_at_demus-online.de>
Date: 27 Feb 2003 06:18:24 -0800
Message-ID: <62e59750.0302270618.18ca9186@posting.google.com>


Hi everybody,

off topic (german to Guido): Bin kein Frühaufsteher, bin im Moment in Canada. thanks for the help, will use the advised procedure of Jim.

But by the way, here is the procedure, wich converts the date into a number: FUNCTION now
return number is
begin

  return to_number(to_char((sysdate  -
          to_date(to_number(to_char(sysdate,'J')-2415019)+2415019,'J') )  +
          to_number(to_char(sysdate,'J')-2415019) )) ;
end;

Thanks again
Oliver

"Guido Konsolke" <Guido.Konsolke_at_triaton.com> wrote in message news:<1046330439.611007_at_news.thyssen.com>...
> "Oliver Demus" <oliver_at_demus-online.de> schrieb im Newsbeitrag
> news:62e59750.0302261920.13223791_at_posting.google.com...
> > Hi there,
> > we save in our database the date as a number e. g. 27. Feb 2003 =
> > 37679.
> > I don´t know the reason for that. But I have no idea, how to convert
> > it back to a date in Oracle plsql. In VB you can do it with
> > cdat(37679).
> > Is there any possibility in Oracle?
> >
> > Thanks in advance
> > Oliver
>
> Hi Oliver,
>
> off topic (german): Mann, Frühaufsteher?
>
> on topic:
> a little test (select sysdate - 37679 from dual)
> showed 30.12.1899 (dd.mm.yyyy) as result.
> So it seems that this app uses the last day of
> the 19th century as the basis. If I'm right with this,
> you can proceed with the advice offered by Jim.
>
> Hth and Grüße,
> Guido
Received on Thu Feb 27 2003 - 08:18:24 CST

Original text of this message

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