This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: `%y' yields only last 2 digits of year
- From: Kevin Handy <kth at srv dot net>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 13 Mar 2002 09:03:12 -0700
- Subject: Re: warning: `%y' yields only last 2 digits of year
- References: <20020313145039.45726F2F02@nile.gnat.com>
Robert Dewar wrote:
><<Which is still wrong since years can span more than just 1900 - 2099.
>What's wrong with using %Y in the first place?
>
>Andreas.
>
>
>You missed my point entirely, probably from not being aware of the Y2K
>issues and solutions.
>
>A common technique for dealing with the Y2K problem, in cases where it is
>impractical to modify data structures or databases, is to use what is usually
>called windowing.
>
>For instance an insurance company may know that it did not exist before
>1982, so any date in the range 82-99 is 1982-1999, and any date in the
>range 00-81 is 2000-2081. This would of course be suitable only for
>policy inception dates, not for client birthdates, but for the inception
>date use, this can keep them going another 80 years, which may be plenty
>(if for example they anticipate a complete system rewrite before 2080).
>
As long as you assume that the insurance company will go bust
long before 2082, and that the software will die with it.
Isn't this type of thinking the cause of all of the Y2K problems
in the first place? Weren't most of the problems with really old
systems that the programmers thought would be replaced
long before there would be a problem?
>
>It was *specifically* for that common technique that I gave my example, and
>the suggestion of using %Y is irrelevant.
>
>Once again, please don't assume you know better than the applications
>programmer what the *applications* requirements are. Warnings in languages
>should be about supposing that you know enough about the *language* in
>which the application is being written to identify constructs that are
>suspicious at the language level.
>