[futurebasic] [FB] Re: Long Date Records

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2005 : Group Archive : Group : All Groups

From: tedd <tedd@...>
Date: Sun, 18 Sep 2005 07:50:30 -0400
David:

>Needing dates before 1904 and after 2042 I have begun using long 
>date records.  It lets you access 60,000 years and has interesting 
>pieces to the record.

I don't know why I remember this, but, _Raoul posted the following in 1996:

First a brief "calendar" history for those who wants to go beyond--beyond--.

First of all, we ought to stop at year 1583. Prior to that, the day 
of the week cannot be calculated (it can-- but the algorithm is very 
complex). In order to understand why we can't calculate the week day, 
we need to look at the calendar history.

Prior to Julius ruling Rome (BC 46) the Roman year was 354 days. When 
Julius came to power, one of his first challenge was to appease the 
farmers who complained big time because according to their calendar 
it is spring time and time to sow/plant but actually it was mid 
winter. Julius hired Sosigenes (a mathematician) to figure out what 
went wrong. A tub of wine and a couple of girls later, Sosigenes 
suggested that the length of the year is wrong. It should have been 
365.25 days. The extra .25 day after four years became the extra day 
added in February. Julius made a mess of 46 BC by adding a couple of 
months (he made money on taxes --BIG time) resulting that 46 BC had 
445 days!

Of course, Sosigenes, not having a calculator, didn't realize that a 
solar year is really 365.2428935 (his calculation was too much by 10 
minutes and some seconds in a year --not bad for manual 
computation!). This error after 1600 years, adds up to about 11 days. 
This is detected by astronomers who noticed that the vernal equinox 
(when light and dark periods are equal in length) occurring on March 
21 was becoming earlier and earlier and in 1582 it was on March 10. 
Christopher Clarius, an astronomer, went to Pope Gregory XIII and 
addressed the concern.

After seeing all the calculations for 7 months, pope Gregory knocked 
off 11 days on October 4 1582. The next day, he decreed to be October 
15 (so October 5-14 in the year 1582 didn't exist), but to not upset 
the Jews with their sabath (see clarification below), the day of the 
week was NOT changed. To avoid this error again after 1500 years, 
Pope Gregory, decreed that every 4 years a day will be added. 
However, on a turn of the century, it will only be added if it's 
divisible by 400. Hence, although year 2000 will be a leap year, year 
1900 was not.

So, the proper leap year test is:

' Leap year is if the year is evenly divisible by 4 and is not
' the turn of the century. If it is it must be evenly
' divisible by 400

isLeap=(yy MOD 4=0 AND yy MOD 100<>0) OR (yy MOD 400=0)

'===========================================================
' dayofweek - Calculate day of the week index
' At entry dd=date, mm=month, yy=year in format nnnn e.g. 1991
'                      this date should first be validated
' At exit z=index to day of the week (1=Sunday, 7=Saturday)
' routine valid for dates 1-1-1583 through 12-31-9999
'===========================================================
LOCAL FN DayOfWeek(mm,dd,yy)
   t!=1/mm
   k1=0.6+t! : l1=yy-k1
   t!=12*k1
   o1!=mm+t! : p1#=l1/100
   z1=INT(p1#/4) : z2=INT(p1#) : z3=INT((5*l1)/4)
   z4=INT(13*(o1!+1)/5) : z=z4+z3-z2+z1+dd
   z=z-(7*INT(z/7))
END FN=z

* _Raoul further clarified:

October 4, 1582 was Thursday. Had Pope Gregory deleted the days 
properly (along with the dates), the next day (October 15) would have 
been a Monday. This would result in that the Jewish citizens will 
need to work more than ten days before being able to observe the 
sabbath. This of course would have been unacceptable, not even 
animals or slaves can be put to work on the Lord's sabbath (Exo 
20:9,31:13,Lev 23:3 etc.)

HTH's

tedd


-- 
--------------------------------------------------------------------------------
http://sperling.com/