thanks
jpl
--
John Patrick Lestrade, PhD
Department of Physics and Astronomy
Mississippi State University, MS 39762
Voice: (601) 325-2806 Fax: (601) 325-8898
Terrell
> Does anyone know of a pc-compatible program that will either 1) print a
> calendar for, say 1991, with the julian dates and/or 2) simply provide
> the julian date as output when a `normal' date is input?
The following works for the Gregorian calendar from 1901 to 2099:
JDN = 367*Y - 7*(Y+(M+9)/12)/4 + 275*M/9 + D + 1721014
where Y = year, M = month, and D = day, and all math must be done in
integer arithmetic. For example, 8/3 = 2, and the fraction is thrown away.
[If your programming language won't handle 7-digit integers, then let Y =
years since 1900, and change the constant in the above formula to 18314, to
get the so-called "modified Julian day number".]
As an example, for Y = 2000, M = 1, D = 1, then the values of the five
terms are 734000 - 3500 + 30 + 1 + 1721014 = JDN 2451545. [In the modified
formula, Y = 100, and MJD = 51545.]
If there is interest in a formula which works for any Gregorian-
calendar date, the following version also takes account of the century
years which are not leap years, such as 1900 and 2100:
J=367*Y-7*(Y+(M+9)/12)/4-3*((Y+(M-9)/7)/100+1)/4+275*M/9+D+1721029
The value of the new term for the above example date is -15; hence it
yields the same answer as the shorter formula for current dates.
If anyone reading this has related needs, such as the reverse formula
(JDN -> calendar date), or the equivalent formula for the Julian Calendar
(the predecesor of the Gregorian Calendar), send me E-mail. -|Tom|-
--
Tom Van Flandern / Washington, DC / met...@well.sf.ca.us
Meta Research was founded to foster research into ideas not otherwise
supported because they conflict with mainstream theories in Astronomy.