Year 2000 Solutions
DJ Delorie
dj at delorie.com
Sat Dec 23 11:18:10 EST 1995
In article <EMERICK.95Dec22121026 at csa.bu.edu> emerick at csa.bu.edu (Emerick Rogul) writes:
> In article <30D9E2EC.4C48 at mindlink.bc.ca> Blake Kadatz <blake_kadatz at mindlink.bc.ca> writes:
> : uspdi at clark.net wrote:
> :: Existing software which represents Year as a two-digit field,
> :: probably will not correctly handle the Year 2000, when 00 becomes
> :: greater than 99.
>
> : Actually, 00 "will become" (or IS) *less* than 99 last time I checked. :)
>
> Yes, it was badly worded. The problem is that 1999 < 2000, whereas
> 00 < 99. So, two-digit year representations are going to be in a lot
> of trouble...
I currently use this logic in all my software:
y = get_year();
y += 2000 if y < 70;
y += 1900 if y < 200;
It seems to be able to guess what the year "meant" and gives me the
right 4-digit number. Substitute "70" for some year that you know
your data started after. (i.e. none of my `years' are before 1970).
It means a rewrite of *my* software, but at least I don't have to
rewrite unix or dos, or rebuild any databases.
DJ
dj at delorie.com
More information about the Bio-soft
mailing list