Re: Help: Y2K problem
Posted in 1999
Topics: Installation, Setup & Upgrades, Server Administration, Platform-Specific Issues
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.
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) Regards -- Helmut Leininger Bull AG / Vienna Open Systems Support Email: h.leininger@bull.at helmut.leininger@bull.net This opinion is mine and not necessarily that of my employer. No guarantees whatsoever.
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 |/ ////////| +----------------------+-----------------------------------+-----------+ ############################################################### 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). Sorry for causing irritations. Regards -- Helmut Leininger Bull AG / Vienna Open Systems Support Email: h.leininger@bull.at helmut.leininger@bull.net This opinion is mine and not necessarily that of my employer. No guarantees whatsoever.