9fans archive / 1999 / 01 / 13 / prev next
From: amos@nso... amos@nso...
Subject: [9fans] Re: Some plan9 y2k problems
Date: Thu, 14 Jan 1999 16:08:00 IST
(I posted this on the plan9 newsgroup, but it isn't gated back to the
9fans list. Apologies for those who see this twice).
presotto@pla... writes:
>In case anyone cares...
>They all involve screw ups in figuring out leap years.
>The ctime.c one is stupidly calls dysize with the year
>minus 1900 instead of the year.
It's not a bug, it's a feature! Because of the year%400 rule, the year
2000 *is* a leap year. Therefore, between March 1, 1900 and Feb. 28,
2100, the year%4 rule alone is valid. UNIX's time span is well within
this range.
Unless someone changes time's type to "unsigned long" or "long long"
before 2038, there's no need to bother the system with code that will
only be executed once in 100 years, and even then come up with the same
result as existing code!
--
Amos Shapir
Paper: nSOF Parallel Software, Ltd.
Givat-Hashlosha 48800, Israel
Tel: +972 3 9388551 Fax: +972 3 9388552 GEO: 34 55 15 E / 32 05 52 N