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: Converting UNIX time to GMT

Re: Converting UNIX time to GMT

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 21 Aug 2002 05:23:45 -0700
Message-ID: <ak00oh01dc3@drn.newsguy.com>


In article <1029925147.10683.0.nnrp-08.c2decc6c_at_news.demon.co.uk>, "Marc[uk]" says...
>
>I have a requirement to display data from an Oracle 8.1.7 table which is
>populated by a 3rd party application. This application happens to store all
>of it's dates in the database as UNIX time (in seconds) but to make this
>meaningful in the report, i need to display it as GMT.
>
>I could do this in SQL Server with the line
>
>DATEADD (ss,<fieldname>,'19700101')
>

select to_date('01011997','ddmmyyyy')+ (1/24/60/60) * ss from t;

that'll be in GMT.

See also
http://asktom.oracle.com/~tkyte/Misc/DateDiff.html http://asktom.oracle.com/~tkyte/Misc/CTime.html

>but the closest function I found to this in Oracle is ADD_MONTHS.. but I
>assume by the name of the function, this works only in months whereas I need
>to convert from seconds.
>
>Any ideas?
>
>regards,
>
>Marc[uk]
>
>

--
Thomas Kyte (tkyte@oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Wed Aug 21 2002 - 07:23:45 CDT

Original text of this message

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