Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: function to get GMT time
Terry,
You're missing the point. There's no built-in knowledge in this function to
determine WHEN to switch from the "S" to the "D". If you're interactively
doing this and you know you are now on DST, then this will work fine.
However, if you're doing this inside a program, there is no method to
automatically determine whether the source or target has now switched to
DST. Plus, the time of the switch will vary from year to year. So, you
will need to build a table to store this switchover points, by country (not
timezone as switchover times vary within timezones -- and some countries do
not have DST) and by year.
The NEW_TIME is just a simplistic function that subtracts or adds hours. Also, there's a very limited number of timezones supported (mainly US plus GMT). Marc Perkowitz
> But all you need to do is substitute the S for a D in the local time.
> select sysdate, new_time(sysdate,'MDT','GMT') from dual;
>
> The D already converts to DST for you.
>
> Terry
>
> Marc Perkowitz wrote:
>
> > Just keep in mind, as I mentioned earlier, DST is not accounted for. So
you
> > will first need to convert from EDT to EST and then use this function.
> > Otherwise your GMT will be one hour off. Of course, if you run your
machine
> > on EST and do not switch to EDT, you will be fine.
> >
> > Oh, I've assuming you really mean Universal Time (UT) when you're saying
> > GMT. If you actually mean the local time for the UK, then you'll need
to
> > take their summer time change into effect also. Their summer time took
> > effect on March 25th this year, while US DST took effect on April 1st.
So,
> > for one week the time difference was less than usual, but now the
difference
> > is consistent.
> >
> > Marc Perkowitz
> > Senior Consultant
> > TWJ Consulting, LLP
> >
> > 847-256-8866 x15
> > www.twjconsulting.com
> >
> > ----- Original Message -----
> > To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
> > Sent: Tuesday, April 03, 2001 1:19 PM
> >
> > > This gives GMT. Thanks! Ruth
> > > ----- Original Message -----
> > > To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
> > > Sent: Tuesday, April 03, 2001 1:15 PM
> > >
> > >
> > > > Hi Andreas,
> > > >
> > > > Please try this.
> > > >
> > > > select sysdate, new_time(sysdate,'EST','GMT') from dual;
> > > >
> > > > Thanks,
> > > > Gurdarshan
> > > >
> > > >
> > > > -----Original Message-----
> > > > [mailto:Andreas.Haunschmidt_at_voest.co.at]
> > > > Sent: Tuesday, April 03, 2001 11:45 AM
> > > > To: Multiple recipients of list ORACLE-L
> > > >
> > > >
> > > > Hi !
> > > >
> > > > Is there a way to get GMT time within PL/SQL independent from
> > > > the local time(zone), I'm looking for a function similar to SYSDATE,
> > > > but it should return GMT instead of the local time.
> > > >
> > > >
> > > > TIA
> > > >
> > > > Andreas
> > > > --
> > > > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > > > --
> > > > Author: Haunschmidt Andreas VASL/FAS
> > > > INET: Andreas.Haunschmidt_at_voest.co.at
> > > >
> > > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > > > San Diego, California -- Public Internet access / Mailing
Lists
> > > > --------------------------------------------------------------------
> > > > To REMOVE yourself from this mailing list, send an E-Mail message
> > > > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > > > the message BODY, include a line containing: UNSUB ORACLE-L
> > > > (or the name of mailing list you want to be removed from). You may
> > > > also send the HELP command for other information (like subscribing).
> > > > --
> > > > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > > > --
> > > > Author: Singh, Gurdarshan (Gurdarshan)** CTR **
> > > > INET: gsaini_at_lucent.com
> > > >
> > > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > > > San Diego, California -- Public Internet access / Mailing
Lists
> > > > --------------------------------------------------------------------
> > > > To REMOVE yourself from this mailing list, send an E-Mail message
> > > > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > > > the message BODY, include a line containing: UNSUB ORACLE-L
> > > > (or the name of mailing list you want to be removed from). You may
> > > > also send the HELP command for other information (like subscribing).
> > >
> > > --
> > > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > > --
> > > Author: Ruth Gramolini
> > > INET: rgramolini_at_tax.state.vt.us
> > >
> > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > > San Diego, California -- Public Internet access / Mailing Lists
> > > --------------------------------------------------------------------
> > > To REMOVE yourself from this mailing list, send an E-Mail message
> > > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > > the message BODY, include a line containing: UNSUB ORACLE-L
> > > (or the name of mailing list you want to be removed from). You may
> > > also send the HELP command for other information (like subscribing).
> > >
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Marc Perkowitz
> > INET: mperkowitz_at_twjconsulting.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Terry Ball
> INET: terry_ball_at_csgsystems.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Marc Perkowitz INET: mperkowitz_at_twjconsulting.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Apr 03 2001 - 15:48:36 CDT
![]() |
![]() |