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: Convert an integer date

Re: Convert an integer date

From: Frederic DEBRUS <frederic.debrus_at_ces-cdr.be>
Date: 11 Nov 1999 09:37:11 GMT
Message-ID: <01bf2c28$5875eaa0$3e35a99e@gal159a>


We known that there is 86399 sec in a day so

select to_date('01-JAN-1970','DD-MON-YYYY') + round(<numberofsec> / 86399) from dual;

you can change the result format by

select to_char(to_date('01-JAN-1970','DD-MON-YYYY') + round(<numberofsec> / 86399),'DD-MM-YYYY') from dual;

TEST


31535635 sec (that is one year)

SQL> select to_date('01-JAN-1970','DD-MON-YYYY') + round(31535635 / 86399) from dual;

TO_DATE('



01-JAN-71 CU
FreD

vigi98_at_my-deja.com wrote in article <80dq3r$8h4$1_at_nnrp1.deja.com>...
> Hello evrybody,
>
> Sorry for this question you should have seen thousands times but I
> don't find the answer.
>
> Does anybody know how to convert, in an Oracle request, an integer
> formated date (the number of seconds since 1970, I assume) to a normaly
> formated date, that is to say dd/mm/yyyy. I know it must be with the
> to_date keyword, but what is exactly the syntax ?
>
> Thanks a lot for your answers.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Received on Thu Nov 11 1999 - 03:37:11 CST

Original text of this message

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