home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.databases:7811 comp.databases.ingres:1874
- Newsgroups: comp.databases,comp.databases.ingres
- Path: sparky!uunet!stanford.edu!ames!nsisrv!stars.gsfc.nasa.gov!thompson
- From: thompson@stars.gsfc.nasa.gov (William Thompson, code 682.1, x2040)
- Subject: Re: Dateformat in 6.4
- Message-ID: <12NOV199220570715@stars.gsfc.nasa.gov>
- News-Software: VAX/VMS VNEWS 1.4-b1
- Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
- Nntp-Posting-Host: stars.gsfc.nasa.gov
- Organization: NASA/GSFC-Laboratory for Astronomy and Solar Physics
- References: <1992Nov5.175319.10856@hsr.no> <1992Nov12.133356.7615@tpghq.com>
- Distribution: usa
- Date: Fri, 13 Nov 1992 00:57:00 GMT
- Lines: 64
-
- In article <1992Nov12.133356.7615@tpghq.com>, sfc@tpghq.com (Steve Caswell) writes...
- >In article <1992Nov5.175319.10856@hsr.no> liland@hsr.no (Trygve Liland) writes:
- >>
- >>
- >>I have a problem with the date datatype in Ingres. I use Embedded SQL from
- >>my C program. Input to the database is OK, so is the data in the database,
- >>but when it comes to output from the db and into my C variable I have a problem.
- >>
- >>I have tried to get the date as date_gmt, but it comes out 6 hours wrong, and
- >>that is not only in my C program but also in ISQL. My platform is HP 730,
- >>HP-UX 8.05. (That is 6 hours wrong GMT)
- >>
- >>Is there a way to get the date, just as it is in the db ?? I have tried most
- >>off the possibillities in the manual, but it still doesn't comes out rigth.
- >>Is it a familiar problem ?, AND is there a solution to it ??
-
- (stuff deleted)
-
- >The following information may help. This is an Expert Note from the INGRES
- >Advisor explaining a problem INGRES has in returning dates that were input
- >during daylight savings time.
-
- (stuff deleted)
-
- > The bug appears when Ingres retrieves a date during DST that was
- >entered during Standard time (or vice versa). Using the above example,
- >let's assume '11-apr-91 12:00:00' was entered during Standard time. There-
- >fore, it was stored in the database as '11-apr-91 20:00:00'. Now, let's
- >say we try to retrieve that date during DST. Once the backend fetches the
- >date, the frontend will convert it by first subtracting the number of
- >minutes west of GMT, giving '11-apr-91 12:00:00'. It then checks to see if
- >DST is currently in effect and finds that it is. Therefore, it adds 1 hour
- >to the time, giving '11-apr-91 13:00:00'. This is not the time that was
- >
- >
- >
- > April 11, 1991
- >
- >
- >
- >
- >
- > - 2 -
- >
- >
- >originally entered and this, therefore, is the bug.
- >
- >
- >2. Workaround
- >
- > The workaround is platform specific, but it involves instructing the
- >operating system to not automatically update the system clock when DST
- >begins or ends. This will guarantee that Ingres always does the same
- >conversion for any date that it has stored. The disadvantage is that the
- >system administrator will have to manually update the system clock twice a
- >year instead of having this done automatically by Unix. This seems a small
- >price to pay compared to the advantages of having a consistent database.
-
- Or, one could ask Ingres to get it right in the first place.
-
- Does this bug also appear in other major database, e.g. Informix, Oracle,
- Sybase, etc.
-
- Bill Thompson
-