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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Getting GMT Time in Oracle?

Re: Getting GMT Time in Oracle?

From: Arman Rawls <no_spam_arawls_at_qwest.net>
Date: Wed, 1 Nov 2000 20:21:01 -0700
Message-ID: <075M5.1620$q81.488666@news.uswest.net>

I wrote a function to due this. It works on Oracle8i only.

function gmtdate

   return date
is

   tz date;
   t varchar2(100);
begin

   select
replace(to_char(sys.standard.sys_at_time_zone(sys.standard.localtimestamp,'0 :00')),'.',':')

   into t from dual;

   tz:=to_date(substr(t,1,21),'DD-MON-RR HH:MI:SS AM');    return (tz);
end;

PoutineQ <poutineq_at_my-deja.com> wrote in message news:8tkchq$s8u$1_at_nnrp1.deja.com...
> Hi,
>
> This is probably a simple question, but I haven't figured it out
> yet. I would like to get the current time in GMT from Oracle (8,
> HP-UX).
>
> In SYBASE, I was able to do "select getdate()", and I am trying to
> port that code to Oracle.
>
>
> The 'sysdate' function returns the local time. But, it does not
> seem to return the time zone. The NEW_TIME() function also seems
> to not be of much help, because I need to have the current
> time zone, plus I would need to know if I'm in DST or not.
>
> Thanks,
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Nov 01 2000 - 21:21:01 CST

Original text of this message

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