Year 2000...
Posted in 1997
Jonathan Leffler wrote: } } Comment 1 } This means one of two things: } * You aren't looking at the dates when you type them. } * Your programs do not show all 4 digits of the year. } I regard the second option as the more likely. The only sensible fix is to } change your programs to display all 4 digits of the year. This has been } true since before I4GL was introduced to the market, and will remain true } into the indefinite future. } } Comment 1 reiterated } Even if you upgrade to a version of I4GL that supports DBCENTURY, } unless you display all 4 digits of the year on the screen, you won't be } able to tell whether it is working correctly for you. Unless you } revise the code to display the full 4-digit year, your code will be } unreliable. } } If your application is designed to run with DBCENTURY unset, then if } you type 23/01/10 (with DBDATE set to dmy4/) after 31st Dec 1999, then } the value will be translated as 23rd Jan 2010. However, if someone } accidentally has DBCENTURY set to P, then the value will be translated } as 23rd Jan 1910 until after 2010, but you won't be able to see that } something has gone wrong unless all 4 digits of the year are displayed. } } ************************************************************* } *** PLEASE, PLEASE, PLEASE, PLEASE *** } *** MAKE SURE YOU ALWAYS DISPLAY ALL 4 DIGITS OF THE YEAR *** } ************************************************************* } } For your own sanity, please get all your code/forms which do not display } 4-digit years and fix them so that they do. } } When you get the necessary upgrade to I4GL, then you will be able to have } DBCENTURY set, and you will be able to enter 2 digits for the year, and } I4GL will display the 4 digit year, and you and your users will be able to } see that I4GL did what you wanted it to do. } } Yours, } Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> } } PS: I've been saying this to clients since 1986, long before I joined } Informix. I've been saying this in c.d.i since 1991. It is still, I } regret to say, necessary to reiterate it -- use 4 digits when you display } dates! I'm not clear why anyone would be having this problem! The way I see it, expecting that an application written as late as the '80's wouldn't be needed for the year 2000+ would be extremely short-sighted. As such, I wouldn't let it pass system test or user acceptance, and as a developer or project leader I wouldn't stand for it. (Removing soap-box: ) Allowing the scape-goat that "it's not my code", what's the big deal about modifying a screen form to extend date fields by two character spaces? MAKE IT FIT! Having a two-digit year is akin to having only 8 characters of a 10-character primary key! I would venture to say that 95% or more of 4gl screens could be easily modified. And considering the wonderful fore-sightedness of Informix (at least I hope it wasn't just accidental) to store the date as an integer, the value in the database would automatically be correct. Hence, just recompile some screens and you're set. I've not messed with DBCENTURY, largely because of the vast expanse of engines in the installed base that don't support it. But I wouldn't be too likely to use it because the support issues associated with the dates working for different users. Plus, not all dates need to be treated the same way. Birthdays would be more likely 19xx, dates in the future more likely 20xx, and dates in the past could be either. The best solution is to ALWAYS use a 4 digit year and let the user type exactly what they want, IMO. No 4gl or engine upgrades would be needed. --Tim