Re: Number of days since 1/1/0001
Re: Number of days since 1/1/0001
- Subject: Re: Number of days since 1/1/0001
- From: Christopher Nebel <email@hidden>
- Date: Fri, 23 Nov 2001 17:22:31 -0800
On Friday, November 23, 2001, at 04:48 PM, Paul Berkowitz wrote:
On 11/23/01 4:20 PM, "Jason Bourque" <email@hidden> wrote:
Just multiple the number of years by 365 then add the days of this year
passed. Then divide the number of years by 4 and add that number from
the
total number of days to count for leap year. Tada, there you go.
There's no leap year every 100 years, except that every 400 years there
is.
And the calendar has been changed several times, as someone mentioned...
Just twice, I think. If we restrict ourselves to the western world (it
gets really hopeless otherwise), the Julian calendar was instituted in
46 BC. It worked pretty much the same as what we use now, but they
didn't add leap years correctly until 8 AD, and they didn't have the
extra rules about 100- and 400-year intervals.
By 1582, the extra leap days had accumulated to the point that it was
becoming obvious, so Pope Gregory (with some help) worked out the
100/400 rule, changed the beginning of the year from March to January,
and (this is the good bit) deleted ten days from the year. The day
after October 4th 1582 was October 15th, at least in Catholic countries.
The upshot of all this is that computing the number of days across the
Julian/Gregorian boundary is non-trivial, and is likely to get you into
arguments no matter which solution you choose. One wonders why you're
bothering.
--Chris Nebel
AppleScript Engineering