< previous page page_181 next page >

Page 181
of "special case" patches for the particular Julian/Gregorian boundary situation. In practice, this situation can be very confusing. Revolutionary Russia would be a case in point. Loyalist "White" areas continued to use the Julian calendar. Areas changed hands, and calendars, for several years.
Listing 7.1 julian_proleptic_to_JD0 ()
/* julp2JD0.c


   +-------------------------------------------+
   |   Copyright (C) 1995 by Lance W. Latham.  |
   |         All rights reserved.              |
   +-------------------------------------------+


   Routine converts a Julian proleptic calendar date into the
   corresponding Julian Day number, expressed as a type double.


   INPUTS:
   1. jdate, pointer to a DATE_INFO structure, containing the Julian proleptic
      calendar date to be converted to its corresponding Julian Day number.


   OUTPUTS:
   1. Returned by routine, type double, the Julian Day number which
      corresponds to the Julian proleptic calendar date input.


   NOTES:
   1. This conversion allows an 'Old Style' (O.S.) date to be converted
      to a Julian Day number.


   2. This routine does not validate the inputs. The routine intercepts years less
      than -4712, months outside the normal 112 range, and days outside the range
      131, and returns '0.0' for these values. To validate Julian calendar dates,
      use the 'valid_date_julian ()' routine in this series.


   3. For dates which fall before 15 OCT 1582 (JD# 2299161), this routine
      functions simply as a date-to-JD# function, since these dates are
      legitimate Julian dates, and not proleptic Julian dates in the
      Gregorian era. Extending backward in time, the Julian calendar reform
      did not result in 'correct' Julian dating in Rome until A.D. 8, due to
      errors in the implementation of the 'new' leap year rule.
*/
#include "scdtl_6.h"


double julian_proleptic_to_JD0 (struct DATE_INFO *jdate)
{
   double jd;
   int y, m, d, y0, g4, r4, i;


/*
   'tab1' contains the number of elapsed days prior to each year of a
   4-year Julian cycle of 1461 days. The first year of a 4-year cycle
   is the leap year, since the JD number system starts in -4712, which
   is a leap year according to the Julian rule.
*/


   int tab1 [4] = {0, 366, 731, 1096};

 
< previous page page_181 next page >