|
|
|
|
|
|
|
The SCDTL system uses the Julian Day number for virtually all work involving conversions between calendars and calculations involving days, dates, and elapsed periods. |
|
|
|
|
|
|
|
|
The core of this system is the set of routines that convert dates in a calendar system to equivalent Julian Day numbers and back again. Thus, to determine the date that falls 180 days from today, convert today's date to its Julian Day number, add 180, and convert the result back to its equivalent date. |
|
|
|
|
|
|
|
|
Likewise, to convert a date in one calendar system to its equivalent in another, simply convert the date in the first system to its Julian Day number, then convert the Julian Day number to its equivalent date in the second system. Use of the Julian day system thus allows you to write one pair of conversion routines for each calendar system, rather than writing routines to convert each system to every other system. |
|
|
|
|
|
|
|
|
With regard to clock time, of course, you again need only write a pair of routines for converting hours, minutes, and seconds to the equivalent fraction of a day, and vice versa. Thus, you have a single system which serves to identify both time and date, expresses both time and date in one format, is mathematically simple, and allows interconversion to any calendar system. |
|
|
|
|
|
|
|
|
2.5.2.3
Conventions and Specific Assumptions |
|
|
|
|
|
|
|
|
In this book, I use the standard Julian Day number as defined by Herschel. Therefore, the year preceding A.D. 1 is year 0, which corresponds to the historical year 1 B.C. In general, to convert a historical B.C. date to its equivalent astronomical year date, subtract one, and place a minus sign in front of the result. Thus, 4713 B.C. is the year 4712. Mathematically, the historical year N is expressed as (N 1), or N + 1. |
|
|
|
|
|
|
|
|
In this book, I employ the type double to express Julian Day numbers. Thus, Julian Day numbers are expressed as decimal fractions, carrying both date and time in one variable. |
|
|
|
|
|
|
|
|
Where routines concern dates only, as they do in calendric date calculations, the routines generally assume that the Julian Day number has a fractional part of zero. Where this assumption is made, the routine name refers to JD0, to indicate that a Julian Day number with zero fractional part is assumed. Typically, any fractional part is truncated internally in such a routine, often by conversion to type long. |
|
|
|
|
|
|
|
|
The reader may encounter other variants of the basic JD# in the literature. Generally, these variants involve throwing away some leading digits that do not change frequently in order to obtain a smaller number for use with frequently referenced dates. One such scheme is the Modified Julian Day (MJD) number, which is often found in work with artificial satellites, where date/time must be frequently repeated. The MJD starts at Greenwich mean midnight, not noon, and essentially throws away the first two digits of the JD#: |
|
|
|
|
|