Delphi32 in the XXI century

It has been given in calling "bug from the year 2000" to a series of errors caused by the habit of the human beings of working with years of two figures. This that up to now produced some very bearable problems, with the century change they will make but pressing.

Delphi, as many programming languages, negotiates the date like the number of days lapsed from December of 1899, 28 that internally which, it is correct for the XXI, XXII and coming century, since for him the 31-12-1999, it will be the 36525, January 1 the 2000 will be the 36526, and so forth.

But inevitably it is necessary to take the dates to the screen to be shown them to the user and to pick up those that this it introduces us, that which makes indispensable the conversion of this numeric date to text format. Is it here where the problems begin since to convert the 36525 to date there is not possible error, but how does it convert Delphi32 the chain 01/01/99 to date? and the chain 01/01/01?.

They exist two groups of functions that they pick up text chains properly formateadas and they transform them into dates:

The solution to this problem is easy: to always use dates with the year of four figures, but this

she/he has two inconveniences.

The solution that we propose you modifies the calls internally to the two groups of functions named previously, making possible that the conversion of dates in format text chain with year of two figures to format dates interns of Delphi32 it is adjusted to one year minimum parametrizable by the developer and amendable in time of execution. This year least one works from a property of a non visual component that is placed in the main Form of the application.

Once installed there is that compile the whole application, included components of third, in the event of having the code source. For we advise it to use the option Project|Build All of the main menu of Delphi.

To install this system we should decompress the package in a directory and to execute install.exe

This process substitutes the file of standard of Delphi, SysUtils.dcu for our own version, keeping the original file as SysUtils.old. Likewise, the installation process believes the file install.log that contains information for UnInstall.exe that will carry out the desinstalación process, in the case of being necessary. The installation processes and unistall require as indispensable condition that Delphi not this being executed.

In case the installation process failed, the user should not have bigger problem to substitute the file by hand SysUtils.dcu for which is included in the package, in the path of Delphi, habitually \Borland\Delphi32\LIB carrying out a copy of security of the original previously.

After executing install.exe, we should use the option Component|install of the main menu of Delphi to install the non visual component that negotiates the minimum year, to give a value to the property FirstYear and to reconstruct the whole application.