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: Number to date

Re: Number to date

From: <jeanch_at_my-deja.com>
Date: Thu, 30 Mar 2000 08:34:07 GMT
Message-ID: <8bv3hu$6cn$1@nnrp1.deja.com>


In article <38E2DEE7.F54803AD_at_blarg.net>, Deepa Dinendra <dinendra_at_blarg.net> wrote:
> Hi,
> I have a table where a column representing date is storing information
> as number (seconds since Jan 1,1970 - from Unix system date). What is
> the best way to convert this number to a date when I query the table?
> One of the solutions I have in mind is divide the number of seconds by
> 86400(seconds in a day) and add it to Jan 1, 1970. but this doesn't
take
> care of the leap years. The table has data only from 1980.
>
> Thanks
> -Deepa
>
>

I Guess oracle should be able to do
Date d;
d := TO_DATE(to_char(number, 'DD-MM-YYYY HH24:MI:SS'), 'DD-MM-YYYY HH24:MI:SS')

OR
TO_DATE(1121212212,'MM DD YYYY) Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Mar 30 2000 - 02:34:07 CST

Original text of this message

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