• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Number of days since 1/1/0001
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number of days since 1/1/0001


  • Subject: Re: Number of days since 1/1/0001
  • From: Bill Briggs <email@hidden>
  • Date: Fri, 23 Nov 2001 21:06:51 -0400

At 7:20 PM -0500 23/11/01, Jason Bourque 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.

It's not that simple. You've accounted for leap years, but century years would also be leap years in your calculation, but they don't have a February 29th unless they are divisible by 400, because after a century of corrections by leap years, it's overcorrected. In other words, every year that is exactly divisible by 4 is a leap year, except for years that are exactly divisible by 100; these centurial years are leap years only if they are exactly divisible by 400. So your method doesn't work. I forget now, but there may be another correction factor if you go back more than 2000 years. This all has to do with the way the rotational period of the earth around the sun relates to the period of rotation of the earth on its axis, and you can bet your boots that this number doesn't divide evenly, and there will be drift over time that requires the addition of "correction factors", which in this case are days added or removed in the form of leap years, or "should-be" leap years that don't. Was that clear?

The issue here is that "doing the date math" is not straight forward. The clock register on modern Macs can handle dates back to about 30,000 years BCE (I forget the exact number, but it's very close to that), but AppleScript is reluctant to let you work with dates of that period. I've not tried to work around this as nothing I've ever done has called for dates of that vintage. There may be a workaround. But this doesn't address the problem at all. There are code samples on the net for doing calendrics in a variety of programming languages, but these won't illuminate the problem for you unless you're adept at one of them. But if you're curious it's worth having a look at the scope of calendar issues. The fact that it's changed a number of times in history, and that different cultures use different calendars doesn't help make it easy. You'll soon discover that when peering into history, our modern date references soon lose relevance, except in as much as they relate to astrological time relative to ours. Even that's a shaky assertion. Sorting out "when" an event happened BCE means first sorting out what you mean by "when". Confused yet?

- web


References: 
 >Re: Number of days since 1/1/0001 (From: Jason Bourque <email@hidden>)

  • Prev by Date: Re: Number of days since 1/1/0001
  • Next by Date: Re: Please explain this!? More....
  • Previous by thread: Re: Number of days since 1/1/0001
  • Next by thread: Re: Number of days since 1/1/0001
  • Index(es):
    • Date
    • Thread