Re: Y2K Solution
Posted in 1997
On Fri, 28 Nov 1997, Mark D. Stock wrote: > Eric Rawson wrote: > > I want to implement Year 2000 solution for an Informix 4GL and ESQL/C > > system by use of the DBCENTURY value (setting it to "C"). > > > > a. Is this supported by Informix in Standard Engine as well as Online? > > That's a very good question. It is documented to be in SE 5.10, but I > can't find any info for version 7.x. It is in 7.2x SE, the same as it is in 7.2x OnLine. It is not in 7.1x SE, any more than it is 7.1x OnLine. > > b. Are there any problems anyone has encountered using DBCENTURY ? > > I haven't heard of any. Bug B60150 is a problem for releases where it isn't fixed. It relates to the conversion of '29/02/00' when using DBCENTURY. > > c. Is it correct to assume that the Year 2000 problem for Informix is > > "fixed" by use of DBCENTURY ? > > Weeell, Informix has never HAD a Year 2000 problem. :-) The problem is > when applications supply only two digits for a year. Using DBCENTURY > helps implement solutions without rewriting lots of code. Yes, and No. As Mark says, there never was a problem with the way that dates were stored (see his answers to question d). However, even with DBCDENTURY, if an application uses 2 digits to represent the year, then it is possible for the application to be processing the wrong data because the user is not aware that the conversion is not working as expected. Also, it is not always true that DBCENTURY="C" will give you the answer you want. The *only* safe way to display dates is with 4 digits for the year. Then, when a value is entered (even with only 2 digits for the year), the user can see what the system has assumed was meant and can correct it if necessary. > > d. Will all date fields held as "date" types but with 2 digit years > > be handled OK ? > > Date values have always effectively stored four digit years. So there > is no change to the actual storage OR display. DBCENTURY just changes > the conversion of two digit years to four digit years. > Without DBCENTURY Informix has always added 1900 to the value. > > So the answer to d. is 'yes'. ;-) But, as before, the application can cause confusion if it only shows 2 digits for the year and DBCENTURY is set incorrectly. Also, you could be confused if the Informix software is not aware of DBCENTURY and the current date is after 31st December 1999 -- typing a 2 digit year will still add 1900 to the date if the Informix software is not aware of DBCENTURY! Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h> PS: See also extensive posts from me previously on this subject, at http://www.dejanews.com or similar archives.