| The first place to look would be METOO::TOOLSHED (hit KP7), which
is primarily concerned with "utilities" (i.e., programs that
do useful things), but does have some routines as well.
You might also try UFP::HACKERS.
-Neil
|
| There is also, in the CLT::MATH notes conf., a copy of a reply to an SPR,
written by Stan Rabinowitz in response to a query about why DEC date routines
do some apparently strange (but actually correct) things - it's the best
exposition of the differences between the various dating systems that I know
of. Definitely worth reading - as an SPR reply it's a classic.
Lynn Yarbrough
|
|
From a little book called "Practical Astronomy with your Calculator"
by Peter Duffett-Smith, CU Press:-
1) Let y = year, m = month and d = day
2) If m = 1 or 2,
a) subtract 1 from y ( i.e. let y = y - 1 )
b) add 12 to m ( i.e. let m = m + 12 )
otherwise leave them alone
3) If date is later than 15th October, 1582 (i.e. Gregorian Calendar),
a) let A = integer part of (y/100)
b) let B = 2 - A + integer part of (A/4)
otherwise B = 0
4) Let C = integer part of (365.25 * y)
5) Let D = integer part of (30.6001 * (m + 1))
6) Julian Day Number = B + C + D + d + 1720994.5
The book also reveals that Julian days are measured from Greenwich mean
noon on January 1st, 4713 B.C., ( The noon being the cause of the .5
in part 6 of the above algorithm ). I just wonder who was at Greenwich
that day to observe the Sun |-}. Furthermore, "Modified Julian date" is
often used, being defined as Julian day number - 2400000.5 , and that
modified Julian date began at 00:00 on November 17th, 1858. I wonder
where I have seen that before!!!
Prior to October 15th, 1582, calculating Julian Day numbers should be easier
as only our normal leap years have to be taken into account. Unless of
course you are trying to go back to Roman times when Julius Caesar (or
least one of his advisors) invented the leap year. Going back that far
introduces a number of other problems, amongst them being the question of
who might have been using the particular calendar apart from the Romans.
Also, at least one Emperor messed around with the numbers of days in
each month, one Augustus added one to August ( |:-l never!!! ) to give
it 31 so that his month should not have fewer than any other. This process
explains why February lost out.
For confusion, you don't have to go back that far unfortunately, as the
Gregorian calendar was not introduced into all the western world at the same
time. Britain and the American Colonies weren't going to follow Catholic
Europe now, were they? Pope Gregorius missed out ten days in 1582, going
straight from October 4th to October 15th. By the time B and the A. C.s
change in 1752, eleven days had to be dropped (due to 1700 not being a leap
year in the Gregorian) and September 2nd was followed by September 14th.
It is interesting to note that George Washington was born on February 22nd,
1732 according to present day calendars and many history books, but his
birth was recorded as being on February 11th in the family Bible. ( Some
of the numbers don't appear to fit here so I apologise in advance if I have
got that a bit wrong.) Russia is another story - they did not change
until 1917.
Another possible source of information could be the astronomy notes
file on:
LDP::ASTRONOMY
There are several pointers there to Planet Ephemeris programs and
these tend to use Julian Dates in there calculations.
I hope all this is of some use still and isn't too long winded. I have
been looking it up for astronomical reasons and as you can see, became
involved. Now we could go onto ephemeris time and leap seconds . . . .
. . . . . . .
Chris
|