< previous page page_464 next page >

Page 464
B.1.2
Some BAD Ideas
The genealogist and others of his ilk often have need to determine the birth date of a person from the date of death and an age given in terms of years, months, and days. Or, given birth and death dates, the age may be desired.
The familiar triad of two point times and an elapsed time between them is here again, with the additional wrinkle that nonuniform months are used as counting units. I therefore consider three possible functions, which accept two of the three variables and return the third. These birth-age-death (BAD) functions each perform correctly, but are prevented from agreeing consistently among themselves by the variability of the month as a counting unit.
Two general utility functions, normalize_date () and decompose_date () are defined and tested in the test program DTLT_179.C. The functions are exercised in an application demonstration in test program DTLT_190.C, which uses sample birth and death data from Der Stadt Friedhof, a cemetery in Fredericksburg, Texas, to illustrate the functions as well as some additional techniques for investigating dates.
The ''8870 rule" is another technique for deriving birth dates from age and death dates. It is investigated in the test program DTLT_165.C.
B.1.3
same_day_N_months_after ()
The same_day_N_months_after () function is one of those functions that seem somewhat arcane until one encounters the real world of monthly business cycles. It would also seem to be a no-brainer. A month after the third of January is just the third of February, right? And a month after the thirty-first of January is just, well, a matter requiring some thought and definition.
This function is defined and tested in the test program DTLT_183.C.
B.1.4
The Hourly End Run
One way to evade the problem of a variable monthly unit is to avoid the use of the offending unit. The Julian Day number uses the unit day and is one answer. Another related method is the use of the time units hour, minute, and second, which are all related by constants. Elapsed time can be expressed in the hourminutesecond (HMS) format, and rather large amounts of time can quite accurately be expressed by using a type long variable to carry the hours. This scheme requires the definition of the HMS_INFO structure.
The necessary functions and structures are defined and tested in the test program, DTLT_174.C.

 
< previous page page_464 next page >