[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::languages

Title:Languages
Notice:Speaking In Tongues
Moderator:TLE::TOKLAS::FELDMAN
Created:Sat Jan 25 1986
Last Modified:Thu May 22 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:394
Total number of notes:2683

145.0. "Algorithm notesfile?" by RHETT::MILLER (Don Miller) Thu Jul 02 1987 01:44

Could someone direct me to a notes file which is basically analogous to the 
"Collected algorithms of the ACM"?  I am looking for a Julian day algorithm 
which, unlike ACM algorithm #199 (as best I recall the number), is not 
restricted to dates on the Gregorian calendar.

						dm.
T.RTitleUserPersonal
Name
DateLines
145.1Try the toolshedTLE::FAIMANNeil FaimanThu Jul 02 1987 17:047
    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
145.2See also MATH notesAKQJ10::YARBROUGHWhy is computing so labor intensive?Mon Jul 06 1987 13:587
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 
145.3Better late than Julian?ERIC::WRIGHTCJTue Sep 29 1987 14:3577

	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