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

Home -> Community -> Usenet -> c.d.o.misc -> Re: DATE field and daylight saving time

Re: DATE field and daylight saving time

From: Juergen Gmeiner <jg_at_tiani.com>
Date: 15 Oct 1998 16:26:08 +0200
Message-ID: <m1hfx552bj.fsf@klondike.tiani.com>


j.penney_at_servicepower.com writes:

> We have a table whose primary key is a DATE field. The dates we are writing
> may potentially be in a time zone which has DST (daylight savings time). All
> the dates *will* be in the same time zone. BUT: suppose I wrote records every
> 30 minutes and the clock went back (for example, from BST to GMT at 02:00am)
> then I'd get a sequence like this, say: 00:40 01:10 01:40 01:10 01:40 02:10
> Crunch! As far as I know (and Oracle seemed to confirm this when we asked) as
> far as Oracle is concerned you can't encode a DST flag into the DATE field.
>
> So: has anyone got a flash of inspiration?

oh well ... you might

  1. have a date field and a dst-flag-field and use the combination of date and dst as the primary key
    • not to bad if the uniqueness of the key is your sole concern
  2. use UTC or your local time without DST internally
  3. use time()-style time values in your database. slightly unix-ish, but time() and localtime() should be quite standard-c. maybe worth a try if your application is in c

regards,
juergen Received on Thu Oct 15 1998 - 09:26:08 CDT

Original text of this message

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