Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Converting Numbers to Dates
Simply do TO_DATE('1/1/1970','mm/dd/yyyy') + seconds/86400 where 86400 is number of seconds in one day:
SELECT TO_CHAR(TO_DATE('1/1/1970','mm/dd/yyyy') +
Seconds/86400, 'mm/dd/yyyy hh:mi:sspm' )
i.e. if Seconds = 844327462, the above statements returns
10/03/1996 07:24:22am
Solomon.Yakobson_at_entex.com
In article <33254A1B.288C_at_citicorp.com>,
andy.smith_at_citicorp.com wrote:
>
> --
> I have a column in a table that stores the number of seconds
> since 1970, as a number ( datatype NUMBER )
>
> e.g
>
> taba
>
> col1 Null Type
> ---- ---- ----
> seconds NUMBER(15)
>
> select * from taba;
>
> seconds
> -------
> 844275235
> 844327462 etc.
>
> How can I convert this to a date e.g 11-MAR-1997
>
> Appreciate any comments.
>
> Regards
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Tue Mar 11 1997 - 00:00:00 CST