Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: GMT to Local Time conversion
Hugo,
The steps you need to take are:
1) Determine how many days are represented by the number of seconds :
seconds/60/60/24
2) Add that number to the date 01-JAN-1970 : this will give you the GMT
date
3) Use the NEW_TIME() function to convert GMT to local time 4) Optionally, format result into date and time using TO_CHAR()
If you substitute <seconds> with your actual date/time value and <local_time_zone> with your time zone the following select statement should get you what you want.
select
to_char(new_time((to_date('01-jan-1970',dd-mon-yyyy')+(<seconds>/60/60/24)),
'gmt','<local_time_zone>'),'mm/dd/yyyy hh24:mi:ss')
from dual;
Mike Morgan
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Hugo Baake <hbbaake_at_pi.net> wrote in article <01bcb17c$ad51c6d0$05c809c0_at_nt4server1>...
![]() |
![]() |