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

Re: Converting UNIX time..

From: Peter Sylvester <peters_at_mitre.org>
Date: Wed, 21 Aug 2002 15:00:14 -0400
Message-ID: <3D63E33E.53F51DC@mitre.org>


Note: better check to see if the original data was derived from "gmt" or "local" Unix time, otherwise you may be off by a number of hours. For "local" time, there may also be that daylight savings issue...

-Peter

Niall Litchfield wrote:
>
> If I understand the question and fieldname contains a time measured as
> elapsed seconds from 01/10/1970 the try
>
> select to_date((fieldname/86400)+to_date('01/01/1970','dd/mm/yyyy')) from
> dual;
>
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
> *****************************************
> Please include version and platform
> and SQL where applicable
> It makes life easier and increases the
> likelihood of a good answer
>
> ******************************************
>
> "Marc[uk]" <top_marcREMOVE_at_hotmail.com> wrote in message
> news:1029933302.14131.0.nnrp-08.c2decc6c_at_news.demon.co.uk...
> > Hi,
> >
> > 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')
> >
> > 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]
> >
> >
> >
> >
Received on Wed Aug 21 2002 - 14:00:14 CDT

Original text of this message

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