Re: Informix 4.1 inquiry
Posted in 1998
FGAnderson wrote: > I know I am behind but does someone have information on > what makes Informix 4.1 Y2K non-compliant. We are > currently using Informix/4gl, Informix/sql, Informix/SE > We have modified the code to use a 4 digit year with > no problems. Any info would be appreciated. The only thing that causes trouble is the handling of 2-digit years on data entry. If you enter 2 digits (eg 99 or 25) for the year when the current date is 2010 (say), then I4GL 4.1 will interpret both dates as being in the 20th Century (1999, 1925), exactly as the documentation says it will. If you show all 4 digits of the year, the user can spot the problem and will eventually get used to typing 4 digits for the year; if you only show 2 digits for the year, there's nothing the user can do. The 'Y2K-compliant' versions of I4GL recognize an environment variable DBCENTURY which will default the century on a 2-digit year to the current century (19xx until 31st December 1999, 20xx thereafter), or can be told to treat all dates with 2-digit years as being in the future (so, given a curent date in 2010, 99 is treated as 2099, 25 is treated as 2025), in the past (so 99=>1999, 25=>1925), or to the date closest to today's date (99=>1999, 25=>2025). In the current products, this is only settable globally. In 7.3 I4GL, there will be a new feature to allow this value to be set in the form file for each field (f000 = sometable.datecol, CENTURY='F';). Note that all of this only (*ONLY*) applies to dates entered with the shorthand 1 or 2 digit numbers for the year. 3 digit numbers are treated as dates in the Dark Ages (100..999 AD); 4 digit numbers are not changed. But if you only display 2 digits for the year during input, all bets are off; if you enter a 4 digit year (eg 04071776) in a field which redisplays the value as 04/07/76, then the chances are that the date will end up being interpreted as 04/07/1976 or 04/07/2076, despite the fact that your initial typing included a century. To repeat myself once more: *** ALWAYS DISPLAY ALL 4 DIGITS OF THE YEAR *** Nothing else is safe. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>