home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / julian.zip / README.TXT < prev   
Text File  |  1997-09-15  |  5KB  |  103 lines

  1. The following programs provide routines to convert
  2. Gregorian and Julian Calendar dates into Julian Days,
  3. and back again.  The algorithms are adapted to Rexx
  4. from 'Numerical Recipes In C', Cambridge Press.
  5. This is a very useful book, and I highly recommend it.
  6.  
  7. The routines are provided as-is.
  8.  
  9. Package contents:
  10.  
  11.   juldate.cmd - Standard Rexx - includes sample 'main'
  12.  ojuldate.cmd - Object rexx version of juldate.cmd
  13.  ojultest.cmd -  A small test program, demonstrating ojuldate
  14.  
  15. Samples include determining DST/STD time dates, and Leap Year.
  16. Usage of the routines is demonstrated in the packages.
  17.  
  18. Copyleft 1996,1997 Kurt Spaugh, Fort Lauderdale, FL 
  19.  
  20. I have not found any problems with the algorithms to date.
  21. That means you probably will...Remember Murphy's Corollary:
  22. "The probability of finding a defect in software is directly
  23. proportional to length of time since the last defect was found"
  24.  
  25. There is no such thing as Defect-Free software.
  26.  
  27. Historically, the calendar is a contrivance for predicting
  28. events future, as well as reckoning the past. The most
  29. notable events are the equinoxes and solstices. In an ideal
  30. calendar, these would always occur on the same date. In a 
  31. simple world, it's nice to know when to plant and harvest.
  32.  
  33. The obvious choice for telling time is the passage of solar
  34. days.  Unfortunately, Solar days do not agree with sidereal
  35. days. Any of the important events above, occur when the
  36. earth is precisely in the same position relative to the sun
  37. that it was a year before. But what is a year? Counting
  38. by solar days (the earth's rotation), really has no bearing
  39. on the time it takes to orbit the Sun. The result is that
  40. any calendar based on Solar days is a fraction less/more than
  41. than the actual time passed. 365 days is just too short,
  42. but 366 days is way too long. Using either, the equinoxes
  43. and solsitices would move backward/forward through the calendar.
  44. As a result, we would soon be seeing 'Spring' in December.
  45. To compensate, the leap year was invented, where the the year
  46. has one extra day.
  47.  
  48. The Julian Calendar, named for Julius Caesar, had leap years
  49. in every year divisible by four. This resulted in too many
  50. Leap days, causing excessive drift in the calendar days of the
  51. Autumnal and Vernal Equinoxes. Having a direct effect on the
  52. date of the 'Movable Feasts', the Roman Church was concerned.
  53. Pope Paul III commissioned  Father Christopher Clavius S.J.,
  54. a noted mathematician to study the problem. The result is the
  55. Gregorian Calendar, named for Pope Gregory XIII, who instituted
  56. the result of Clavius' research on Thursday, October 4, 1582. Thus,
  57. Thursday, October 4, 1582 was followed by Friday, October 15, 1582.
  58. The eleven day jump, corrected the accumulated error of the Julian
  59. calendar since its adoption in 45 B.C.
  60.  
  61. In the Gregorian Calendar, Century years are not leap years unless
  62. they are divisible by 400. So 2000 is a leap year but 1900 is not.
  63.  
  64. The 'Julian Day' is not related to either Calendar. It was, however,
  65. devised in 1582 by Joseph Scaliger. It is a means of reckoning
  66. time between widely spaced astronomical events, and is used today
  67. by all astronomers. Julian Days are counted from 1/1/4713 B.C.
  68. The Julian period is  7980 years, the LCM of the lunar cycle(19 years),
  69. the solar cycle(28 years),and the Roman Indiction cycle(15 years).
  70. The last concurrence of all three was in 4713 B.C. The Julian Day also 
  71. begins at noon, a convenience for astronomers, so that the day will not
  72. change during their night-time working hours.
  73.  
  74. A proper julian date is of the form dd.ff, where 'dd' is the Julian 
  75. day number and 'ff' is the fraction of the day. The next millenium
  76. begins at  2451910.5, which is midnight, December 31, 2000.
  77.  
  78. The algorithms here omit the time of day, and for sanities sake
  79. choose to assume that you are always working in the afternoon.
  80. Should you choose to be more precise, or reconcile with GMT or 
  81. Naval Observatory time, Don't forget to account for the time of
  82. day.
  83.  
  84. The US Naval Observatory cesium clock time is available by modem
  85. at 1-202-653-0351 (1200,7,Even,1). It transmits a string like:
  86.   "50706 257 13:21:00 UTC" 
  87.    xxxxx ddd hh:mm:ss TZ
  88.  
  89. xxxxx = Julian Day - 2,400,000
  90.         Note that until 12:00:00 UTC, that value would be 5075!
  91.  
  92. ddd   = The day of the year (Jan. 1 = 1)
  93.  
  94. hh:mm:ss = hours:minutes:Seconds
  95.  
  96. If you are an astronomer, and choose to use the enclosed algorithms
  97. to predict an appointment with a telescope on a gregorian date,
  98. it is up to you to incorporate time of day into the jul2greg()
  99. function. For the rest of us 245076 began at Midnight!.
  100.  
  101. Have fun...
  102.  
  103. kurt spaugh@bellsouth.net