Unix Technical Forum

Re: Get UTC time

This is a discussion on Re: Get UTC time within the Oracle Database forums, part of the Database Server Software category; --> Geld Marcoss wrote: > Hello Oracle experts, > > I want to store date and time values always in ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 01:42 AM
Frank van Bortel
 
Posts: n/a
Default Re: Get UTC time

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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:58 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com