Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Converting Numbers to Dates
Andy Smith wrote:
>
> --
> I have a column in a table that stores the number of seconds
> since 1970, as a number ( datatype NUMBER )
>
> How can I convert this to a date e.g 11-MAR-1997
Convert it to days by dividing by the number of seconds in a day, and then add it (as a number) to the Oracle DATE representation of 1st January 1970.
E.g.
SQL> select to_char(
2 to_date('01-JAN-1970','DD-MON-YYYY') + ( 844275235 / (60*60*24)),
3 'DD-MON-YYYY HH24:MI:SS') mydate
4 from dual;
MYDATE
![]() |
![]() |