Re: Help: Y2K problem
Posted in 1999
Helmut Leininger wrote: > > Helmut Leininger wrote: > > > > Tony Zhou wrote: > > > > > It works now. > > > > > > Tony Zhou wrote: > > > > > > > Hi Informix DBAs: > > > > > > > > I installed informix-SE and informix-SQL on my linux machine. > > > > > > > > There is a date field in a form. > > > > f1 = my_date, reverse, format = "mm/dd/yyyy?; > > > > > > > > When user adds mm/dd/yy, the informix converts to mm/dd/19yy > > > > automatically. > > > > > > > > How to force users input 4 digits year ( mm/dd/yyyy). > > > > > > > > Thank you in advance. > > > > Hi, > > > > If your Version of Informix is at least 7.20 you may bypass your problem > > by setting the DBCENTURY variable. > > > > DBCENTURY=P # past (always 19xx) > > DBCENTURY=F # Future (99 -> 1999, 00 -> 2000) > > DBCENTURY=C # Closest (87 -> 1987, 13 -> 2013) > > That's a little generalised, isn't it? DBCENTURY will set the century > based on the whole date. Your future example for one, if you put in > today's date with a two character year, you will get a century of 20, > not 19. Be very careful with these general descriptions, both past and > future will evaluate two dates, while closest will evaluate three. > > Also, I am not sure this answered the question, which I read to be, "how > do you force 4 character year input?" Well Jonathan has answered this > many times over, but basically you can't, easily. > > Mark, > > You are absolutely right, this shot was a bit too quick and not well > reflected. DBCENTURY regards the whole date and not only the year. > DBCENTURY=P may even insert 1899. The examples should have been more > extensive. > > Yes, it is not an exact answer to the question. But setting DBCENTURY=C > might be an acceptable bypass without having to modify the programs (for > storing the dates into the DB, the other problems when reading and comparing > dates - 99 is still greater than 00 - remain). You will not experience these problems if you use a date type, instead of some other data type for inputting dates. Once the date is input, it is converted to a full date and can be compared to any other full date. If you use CHAR or some other data type to store dates, then you will have the same problems as all the others scrambling to make the deadline. ;-) > Sorry for causing irritations. That wasn't you, that was my fleas. :-) Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock http://www.informix.com |//////// /| | mailto:mdstock@mydas.freeserve.co.uk |///// / //| | http://www.iiug.org +-----------------------------------+//// / ///| | |What year 2000 bug? year 2000 bug? |/// / ////| | |year 2000 bug? year 2000 bug? year |// / /////| | |2000 bug? year 2000 bug? year 1900 |/ ////////| +----------------------+-----------------------------------+-----------+