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: utc time

Re: utc time

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 11 Jun 1999 15:26:24 GMT
Message-ID: <37612a80.670303@newshost.us.oracle.com>


A copy of this was sent to Thomas Beetz <t.beetz_at_fnt.de> (if that email address didn't require changing) On Fri, 11 Jun 1999 15:51:05 +0200, you wrote:

>Hi
>
>I'm looking for simple way to translate utc time (an integer column of a
>table) in oracle date format.
>
>Thanks Thomas

If you know your timezone and that timezone is supported by NEW_TIME (or if you know your offset from UTC), yes

...
time_t theTime;
varchar otime[50];

    time(&theTime);

    printf( "%s", ctime( &theTime ) );

    EXEC SQL SELECT to_char(

        new_time( to_date('01011970','ddmmyyyy') + 1/24/60/60 * :theTime,
        'GMT', 'EDT' ), 'dd-mon-yyyy hh24:mi:ss' )
        into :otime from dual;

...

Wed May 13 21:35:06 1998
13-may-1998 21:35:06

this will do it in the timezone EDT....

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/

Current article is "Fine Grained Access Control", added June 8'th  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Jun 11 1999 - 10:26:24 CDT

Original text of this message

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