Re: Y2000 and 29/02/00~v
Posted in 1997
Jonathan Leffler wrote: > > If you are using a two digit year with DBCENTURY set to C and try and > > insert the date 29/02/00 you will get a 1204 - Invalid year in date. > > I can confirm that for OnLine 7.23.UC1 on Solaris 2.5.1. > Same on AIX. > > > Not in my book. The error message doesn't make sense. Invalid day in date > would be explicable -- the conversion to 4-digit year was taking place > after the leap year check. I suppose it could be that they are taking the > 2-digit year (00) and treating is as a 4-digit year before doing the > addition; then it is an invalid year (there was no year 0; it went 1 BC to > 1 AD). > This does not seem to be the case exactly. The year 00 (meaning 2000) is accepted. It accepts also "00/02/28" (DBDATE=Y2MD/". I think the mistake is that all years xx00 are *no* leap years except if the century is a multiple of 4 - and Informix seems to do the leap year calculation before adding the century ("2000/02/29" is ok). > Yours, > Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> Regards Helmut.Leininger@bull.net