12.1.8 Julian_Day Procedure

The Julian_Day procedure calculates the Julian Day for a given Year, Month and Day for a specific calendar (Julian or Gregorian).

Days in a Year

The Romans originally counted years ab urbe condita (a.u.c.), that is, ``from the founding of the city (Rome)'', posited as April 21, 753 BC. However, common usage numbered years by starting at one every time a new Caesar's reign began. Days were added and subtracted from time to time to keep the calendar on track with the season, which led to problems with planning and abuses for political purposes. (To calculate the equivalent a.u.c. year, add 753 to an AD year or subtract a BC year from 754. This is a rough estimate and may be off by a year.)

To correct problems with this calendar, Julius Caesar instituted a new calendar in 709 a.u.c. (45 BC). This calendar, called the Julian calendar, had years of 365 days and leap years of 366 days every fourth year. Months had a constant number of days, with a new month being added to refer to Julius Caesar himself (July). The year of 45 BC is often called the ``year of confusion'', as 90 days were added to the year to realign with the seasons.

The Julian calendar was a distinct improvement, but its year length of 365.25 days differed from the true year by about 11 minutes. Two possible values for the true year length are the vernal equinox year, 365.2424 days, and the tropical year, 365.24219 days. The discrepancy in the Julian calendar accumulates to a day roughly every 131 years.

Over the centuries the equinoxes and solstices migrated from their former places in the calendar, which caused problems in the Roman Catholic Church because the determination of the date of Easter was affected. Eventually, Pope Gregory XIII issued a papal bull establishing what is now called the Gregorian calendar. The Gregorian calendar modified the addition of leap days, such that a century year (divisible by 100) was only counted as a leap year if it was also divisible by 400. The Gregorian year length of 365.2425 days is much closer to the true year length, differing by somewhere between 8 and 27 seconds (depending on which true year is used). An entire day of error accumulates in either 3,226 or 10,000 years.

Adoption of the Gregorian calendar required dropping some days to realign the equinoxes and solstices. The first adoption of the Gregorian calendar was by the Catholic countries of Italy, Poland, Portugal, and Spain. They dropped 10 days, following 4 October 1582 immediately with 15 October 1582. Other Catholic countries followed suit, Protestant countries changed over the next two hundred years, and Greek Orthodox countries (Russia, Romania, Bulgaria, Turkey) did not change until the early 1900s. Great Britain and colonies (including American colonies) dropped 11 days when they adopted the Gregorian calendar, following 2 September 1752 with 14 September 1752. (Unix users can see that this fact is incorporated into the cal program by typing ``% cal 9 1752''.)

Extending a calendar before the time when it was adopted is referred to as the ``proleptic'' version of that calendar.

Year Numbering Systems

The designation ``A.D.'' is an abbreviation of ``Anni Domini Nostri Jesu Christi'', i.e., ``in the year of Our Lord Jesus Christ'', and ``B.C.'' signifies ``Before Christ''. There was no year zero in this system - that is, the year 1 BC was followed by 1 AD. A more religiously-neutral system replaces A.D. with C.E. (for Christian Era) and B.C. with B.C.E. (Before Christian Era), and leaves the numbering unchanged.

A third system is called the Common Era calendar, which uses the designation C.E. only. It includes a zero year and negative years, so that 2000 AD = 2000 CE (Christian Era) = 2000 CE (Common Era), and 2 BC = 2 BCE (Before Christian Era) = -1 CE (Common Era).

Julian Days

Julian Day numbers had their beginnings in a numbering system that was designed by Joseph Scaliger in 1583. It is sometimes erroneously stated that the system was named to honor his father, Julius Caesar Scaliger, but Scaliger himself wrote "We have termed it Julian because it fits the Julian year ...". His system was based on a 7980-year cycle which started on 1 January 4713 BC in the proleptic Julian calendar.

The astronomer John W. F. Herschel extended this idea to a system which numbered all the days consecutively starting at noon on 1 January -4712 CE (Julian). Noon was used so that the day number would not change in the middle of a night observation. Chronological Julian Day numbers were subsequently defined to start at midnight at the start of 1 January -4712 CE (Julian).

Some representative Julian Day numbers are given in Table 11.1.8.

Table 11.18: Chronological Julian Day numbers for some representative dates.
Date (BC/AD) Date (CE) Julian Day Julian Day
    (Julian Calendar) (Gregorian Calendar)
4714 BC/11/24 -4713 CE/11/24 -38 0
4713 BC/01/01 -4712 CE/01/01 0 38
753 BC/04/21 -752 CE/04/21 1446501 1446509
2 BC/10/30 -1 CE/10/30 1720995 1720997
1 BC/01/01 0 CE/01/01 1721058 1721060
1 AD/01/01 1 CE/01/01 1721424 1721426
200 AD/02/28 200 CE/02/28 1794166 1794167
200 AD/02/29 200 CE/02/29 1794167 1794168
200 AD/03/01 200 CE/03/01 1794168 1794168
300 AD/02/28 300 CE/02/28 1830691 1830691
300 AD/02/29 300 CE/02/29 1830692 1830692
300 AD/03/01 300 CE/03/01 1830693 1830692
1582 AD/10/04 1582 CE/10/04 2299160 2299150
1582 AD/10/14 1582 CE/10/14 2299170 2299160
1752 AD/09/02 1752 CE/09/02 2361221 2361210
1752 AD/09/13 1752 CE/09/13 2361232 2361221
1858 AD/11/16 1858 CE/11/16 2400012 2400000
1968 AD/05/23 1968 CE/05/23 2440013 2440000
1995 AD/10/09 1995 CE/10/09 2450013 2450000
2000 AD/01/01 2000 CE/01/01 2451558 2451545
2132 AD/08/31 2132 CE/08/31 2500014 2500000

See http://www.hermetic.ch/cal_stud/jdn.htm, http://www.hermetic.ch/cal_stud/cal_art.htm, http://penelope.uchicago.edu/~grout/encyclopaedia_romana/calendar/consuls.html, http://en.wikipedia.org/wiki/Ab_urbe_condita, http://en.wikipedia.org/wiki/Julian_calendar, http://en.wikipedia.org/wiki/Gregorian_calendar, http://en.wikipedia.org/wiki/Julian_day, and http://astro.nmsu.edu/~lhuber/leaphist.html for more detailed discussions.

Calling syntax:

integer = Julian_Day(Year, Month, Day, Calendar, Debug)

Input variables:

 Year  Year number, with negative numbers for BC and positive numbers for AD. There is no year zero. This procedure will give accurate results (corresponding to the proleptic Julian and Gregorian calendars) from 4713 BC onward. [years]
 Month  Month number. [1-12]
 Day  Day number. [1-31]
 Calendar  Character variable specifying whether to use the Julian or Gregorian calendar (Gregorian is the default).
 Debug  Debug toggle, needed to turn off very slow checking during 1000s of repeated calls in the parallel versions of the unit test. (.true. is the default). [optional]

Output variables:

 Julian_Day  The chronological Julian Day number for the input date. [days]

Internal variables:

 Julian_Day_Constant  The number of days between the zero date of the Julian Day numbering system (1 January -4712 CE) and the zero date of this Julian Day calculation (30 October -1 CE). [days]
 Julian_Month  A month number which has been adjusted for ease of calculation. Ranges between 4 and 15.
 Julian_Year  The year, with negative values shifted by one so that there is a "zero year" (there was no zero year between 1 BC and 1 AD). This is also known as the Common Era (CE) year. [years]
 Shifted_Julian_Year  The Julian year shifted by 8000 years for ease of calculation of leap days. [years]

The Julian_Day code listing contains additional documentation.

Michael L. Hall