NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
From: Sean C
Date: 2024 Mar 28, 19:10 -0700
Paul wrote:
The following method is valid for positive as well as negative years, but not for negative JD.
Let Y be the year, M the month number (1 for January, 2 for February, etc., to 12 for December), and D the day of the month (with decimals, if any) of the given calendar date.
If M > 2, leave Y and M unchanged. If M = 1 or 2, replace Y by Y - 1, and M by M + 12. In other words, if the date is in January or February, it is considered to be in the 13th or 14th month of the preceeding year. In the Gregorian calendar, calculate A = INT(Y / 100); B = 2 - A + INT(A / 4). In the Julian calendar, take B = 0. The required Julian Day is then: JD = INT(365.25 (Y + 4716)) + INT(30.6001 (M + 1)) + D + B - 1524.5 ([formula] 7.1)
The number 30.6 (instead of 30.6001) will give the correct result, but 30.6001 is used so that the proper integer will always be obtained. [In fact, instead of 30.6001, one may use 30.601, or even 30.61.] For instance, 5 times 30.6 gives 153 exactly. However, most computer languages would not represent 30.6 exactly - see in Chapter 2 what we said about BCD** - and hence might give a result of 152.999 9998 instead, whose integer part is 152. The calculated JD would then be incorrect.
In formula (7.1), the constant 4716 has been added to the argument of the first INT function, in order to avoid trouble for negative years.