From owner-freebsd-questions Mon Oct 27 10:50:55 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA14204 for questions-outgoing; Mon, 27 Oct 1997 10:50:55 -0800 (PST) (envelope-from owner-freebsd-questions) Received: (from jmb@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA14191; Mon, 27 Oct 1997 10:50:44 -0800 (PST) (envelope-from jmb) From: "Jonathan M. Bresler" Message-Id: <199710271850.KAA14191@hub.freebsd.org> Subject: Re: 2000 Compliance / dates / time libs To: steve@visint.co.uk (Stephen Roome) Date: Mon, 27 Oct 1997 10:50:44 -0800 (PST) Cc: jmb@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG In-Reply-To: from "Stephen Roome" at Feb 29, 0 04:57:07 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Stephen Roome wrote: > > On Mon, 27 Oct 1997, Jonathan M. Bresler wrote: > > > Stephen Roome wrote: > > > > > > > > > I just set my clock to february 29 2000. Is this valid ? > > > > the algorithm, as i understand it is: > > > > if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) > > it is a leap year. > > > > this is only good back till the switch from julian to gregorian > > calendars. > > [You stole this from k&r didn't you =), well, that's the only place I > remember seeing this, especially in this format in C.] hrummmmp! absolutely not! i started with if ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0)) then switched it around ot get the most frequent test case up front. > So when (or if) does the julian/gregorian switch take place and have you > got any hints where I should "point my browser and surf to", or perhaps a > slightly reliable source of information such as a book. from man cal(1) The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd of September. By this time, most countries had recognized the reforma- tion (although a few did not recognize it until the early 1900's.) Ten days following that date were eliminated by the reformation, so the cal- endar for that month is a bit unusual. > > I've heard (I don't trust this source though!) that there maybe an ISO > committee for this. sure there is, their report will be ready on june 15th 2003. ;) jmb