Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DATE field and daylight saving time
On Fri, 16 Oct 1998 08:26:42 GMT, j.penney_at_servicepower.com wrote:
>Tommy Wareing (see below) emailed me directly with the idea of storing in GMT
>but using DB triggers to adjust by time zones for a view onto the data.
>
>This is a neat idea except... Our apps are intended to be international and
>I'd have to hard-code the time zone rules in PL/SQL - I've looked into this
>and believe me it is *NON-TRIVIAL*! There are all sorts of huge
>complications with time zones and DST - Unix sorts it all out internally so I
>don't have to worry about it in my apps (and DST rules change occassionally
>in different locales as well!). I really, really don't want to do this
><vbg>!
Thanks for the complement. More neat ideas follow :-) (YMMV)
Do you really need to put all the DST rules into the database? Or do you just need the current timeshift for each timezone? In which case you could have a table containing such data, and have a unix process recalculate these periodically. It's a kludge, but it does avoid rewriting stuff in PL/SQL
Of course, if data was retrieved using the old timeshift, and then written back using the new timeshift, you're back to the original problem. Oops.
A refinement: put the timeshift into a package variable *which doesn't change value* for the duration of the session. That'll solve that problem. It'll probably cause others... these things do :-)
--
Tommy Wareing
MIS Group
Learning Resources
Oxford Brookes University
01865 483389
Received on Fri Oct 16 1998 - 06:11:33 CDT