Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Daylight Savings Time Translation Error with Oracle 8i
Hi David,
Using the number you retrieve for the epoch time, you can can derive the date, and then convert it from GMT to the time zone you want. You can use Oracle's new_time function, provided it supports your time zone.
http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a85397/function.htm#78068
For example, let's say you retrieve a row where the epoch date is 1000000. Converting it to days gives you:
SQL> select 1000000/(24*60*60) from dual;
1000000/(24*60*60)
11.5740741
So, a little over 11 days past the 1st of January:
SQL> select to_date('JAN-01-1970','MON-DD-YYYY')+(1000000/(24*60*60)) from dual;
TO_DATE('
TO_CHAR(NEW_TIME(TO_DAT
SQL> select
to_char(new_time(to_date('JAN-01-1970','MON-DD-YYYY')+(1000000/(24*6
0*60)),'GMT','EST'),'MON-DD-YYYY HH:MI:SS AM') from dual;
TO_CHAR(NEW_TIME(TO_DAT
1* select
to_char(to_date('JAN-01-1970','MON-DD-YYYY')+(1000000/(24*60*60))+(1
0/24),'MON-DD-YYYY HH:MI:SS AM') from dual
SQL> /
TO_CHAR(TO_DATE('JAN-01
Regards,
Arun
Received on Tue Apr 12 2005 - 13:44:14 CDT
![]() |
![]() |