Newsgroups: comp.lang.c
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!cunixa.cc.columbia.edu!jhz
From: jhz@cunixa.cc.columbia.edu (Jennifer H. Zemsky)
Subject: Re: Request for simple date routines.
Message-ID: <1991Apr14.184903.10338@cunixf.cc.columbia.edu>
Sender: usenet@cunixf.cc.columbia.edu (The Network News)
Nntp-Posting-Host: cunixa.cc.columbia.edu
Reply-To: jhz@cunixa.cc.columbia.edu (Jennifer H. Zemsky)
Organization: Columbia University
References: <1991Apr9.234255.143@mprgate.mpr.ca>
Date: Sun, 14 Apr 1991 18:49:03 GMT

In article <1991Apr9.234255.143@mprgate.mpr.ca> stone@mars.mpr.ca (Darren Stone) writes:
>
>
>I really don't care at all about efficiency, but
>they must work absolutely reliably for +/- several
>hundred years (taking into account the leap-year
>rules).  Actually, what are the leap year rules?
>Something about evenly divisible by 4, except
>not by 100, except by 400?
>
can't help with the first two, but the rule of leap years is:
leap = (((year/4 is int) && !(year/100 is int)) || (year/400 is int))
this is why many electric calendars go from 1901 - 2099 ... it saves the
check of year/100.

good luck.


>- Darren -


