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

Home -> Community -> Usenet -> c.d.o.server -> Re: Get UTC time

Re: Get UTC time

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Sat, 03 Dec 2005 16:42:24 +0100
Message-ID: <dmsdpv$k7n$1@news5.zwoll1.ov.home.nl>


Geld Marcoss wrote:
> Hello Oracle experts,
>
> I want to store date and time values always in UTC (paying attention to
> daylight savings) in a DATE filed as a default value.
> (eg.: MYDATE DATE DEFAULT=???sysdate???)
>
> The problem is that the OS has a timezone settings eg.: Asia/Peking and
> use always the actual local time (Daylight saving is handled correctly
> by the OS). And so sysdate gives back a localtime and not UTC time. I
> know that I can setup a dbtimezone for my database and update the
> localtime with that value, but don't know how.
> I mean if I set it to eg.: +09:00 than what happens with daylight
> saving? I should have the +09:00 in summer and +08:00 in winter but the
> dbtimezone is always +09:00.
>
> Besides this as I know the string representation for timezones can be
> different between the Oracle and the OS, isn't it?
>
> Any idea?

Not possible.
At least, not with a lot of hassle. Why not use a date with local timezone - it will always allow to recalculate to UTC; in whatever timezone your server may be; it thus allows to compare time and dates referencing UTC from servers in different timezones.

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Sat Dec 03 2005 - 09:42:24 CST

Original text of this message

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