| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Convert an integer date
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('
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
![]() |
![]() |