Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: get UTC date in Oracle 7.3.4

RE: get UTC date in Oracle 7.3.4

From: <Andreas.Haunschmidt_at_voestalpine.com>
Date: Wed, 10 Mar 2004 19:14:00 +0100
Message-ID: <0F639AFBF6850240BCBADA6887DDDFCF3F207D@mail02.voest.co.at>


Thanks Kevin!

Your example works, but:

I tried ( on 9.2, since I have no access to the 7.3.4 instance; my collegue still has to try it on 7.3.4, but I suppose the same error will happen ):

  select to_char(new_time(sysdate,'CEST','GMT'),'YYYY-MM-DD-HH24.MI.SS') from dual

                                *

  ERROR at line 1:
  ORA-01857: not a valid time zone

The problem is, new_time accepts only a few timezones, but unfortunately we have Central European Time here in Austria, additionally the daylight saving madness time switch happens here too.

But maybe I can use one of the supported timezones (with daylight saving time),
apply an offset in order to get our timezone and use new_time then.

I still have to figure out, if the "switching days" of the valid timezones for new_time
are the same as in the European Union...

<CHAGRIN>
  Getting UTC Time in Oracle is still a mess, even in 9.2 there is no built in function
  a la UTCSYSDATE...
</CHAGRIN>

Andreas

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Kevin Lange Sent: Wednesday, March 10, 2004 6:38 PM
To: 'oracle-l_at_freelists.org'
Subject: RE: get UTC date in Oracle 7.3.4

How about the NEW_TIME function . Such as :

select to_char(new_time(sysdate,'CST','GMT'),'YYYY-MM-DD-HH24.MI.SS') from dual

-----Original Message-----

From: Andreas.Haunschmidt_at_voestalpine.com [mailto:Andreas.Haunschmidt_at_voestalpine.com] Sent: Wednesday, March 10, 2004 11:26 AM To: oracle-l_at_freelists.org
Subject: get UTC date in Oracle 7.3.4

Dear List Members!

A collegue running Oracle 7.3.4 needs to get the SYSDATE in UTC (GMT), as far as I know, there is no trivial solution to get this done in SQL or PL/SQL only.
We would be grateful, if anyone had a solution... Any ideas?

Thanks in advance

Andreas



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Wed Mar 10 2004 - 12:11:33 CST

Original text of this message

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