Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: utc time
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--
![]() |
![]() |