next up previous contents index Search
Next: 0.5.5.1 A Brief History Up: 0.5 Miscellaneous Algorithms Previous: 0.5.4 Exponentiation

         
0.5.5 Julian Calendar Algorithms

Included here are several Julian day routines. The date_to_julian is a calculation that assigns (almost) any date a single (large) integer. This integer cooresponds to the number of days between a set starting date and the given date. The difference between the Julian numbers of any two dates is exactly the number of days between the respective dates. By performing modulo division on the Julian number of a date you can easily determine on what day-of-the-week it fell. A division of a date's Julian number by seven with no remainder means that the date is a Sunday. A remainder of six means that the day is a Saturday. Further, a date's validity can be checked by converting it into a Julian number, converting the resultant Julian number back into a calendar date, and comparing the two.



 
Scott Gasch
1999-07-09