< previous page page_40 next page >

Page 40
2.4
What You Need Date/Time Code to Do
You want to do two fundamental things with date/time functions. The first is to relate time to date. The second is to perform calculations with dates.
In the first case, you want to know how many seconds are left in the day, how much longer the experiment will run, what fraction of a day is consumed by an activity, and so on.
In the second case, you want to know how many days until Christmas, what date the contract expires if it happens 180 days from today, when Easter falls this year, whether Friday the thirteenth falls on a full moon, what date the fourth Thursday in March is, and so on.
You also want to be able to relate events in different calendar systems to each other. Performing math in any one calendar system is often difficult and time consuming. Relating two or more of them can be a challenge.
2.5
A Linear Time Scale
In this section, I outline the basic argument for a linear time scale and present the one used in the SCDTL system.
2.5.1
Why You Need One
Date/time calculations are a problem for two basic reasons:
The units are related cyclically, not linearly. January plus 190 days is July, but January plus 365 days is January again.
The units are not related by simple metric rules. The number of days in a month is not constant in many calendars. The number of months per year varies in many calendars, and the number of days in a year varies in most calendars. Rules for
Table 2.3 Planet indices.
Number, nIndex = n mod 7Planet
1 1 mod 7 = 1Saturn
25 25 mod 7 = 4Sun
49 49 mod 7 = 0Moon
73 73 mod 7 = 3Mars
97 97 mod 7 = 6Mercury
121121 mod 7 = 2Jupiter
145145 mod 7 = 5Venus

 
< previous page page_40 next page >