Re: Help: Y2K problem
Posted in 1999
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. 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 |/ ////////| +----------------------+-----------------------------------+-----------+