Julian Calendar and Gregorian Calendar Algorithms

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Vol.

9 · January
IAMURE 2014 Journal of Mathematics, Engineering & Technology
International
Print ISSN 2244-159X · Online ISSN 2244-1603
International Peer Reviewed Journal
doi: http://dx.doi.org/10.7718/iamure.ijmet.v9i1.794
This Journal is produced by IAMURE Multidisciplinary Research,
an ISO 9001:2008 certified by the AJA Registrars Inc.
Journal Metrics: H Index = 1 from Publish or Perish

Julian Calendar and Gregorian


Calendar Algorithms
ISMAEL T. FORTUNADO
ORCID No. 0000 0002 1837 6423
smile.macky.fortunado@gmail.com
University of Santo Tomas, Philippines

ABSTRACT

The study aimed to develop a relationship between Gregorian calendar dates


in AD and Julian calendar dates in AD which is shown as algorithms. It also
solved ordinal numbers of dates and dates of ordinal numbers that are in AD
with the use of algorithms. Dates of ordinal numbers were also solved using
algorithms. Algorithms for converting a Julian calendar date into the Gregorian
calendar date and vice versa were derived; conversions for the two calendars were
derived. The study used applied Mathematics using derivation of Algorithms in
answer to the objectives. There were sample problems to check the accuracy of
the algorithms; the algorithms are correct. Six algorithms were established.

KEYWORDS

Algorithm, Anno Domini, calendar, formula, Gregorian calendar, Julian


calendar, descriptive design, Philippines

28
Vol. 9 · January 2014

INTRODUCTION

Calendars are used as a system of measurement for time with the day as
smallest calendrical unit by convention (Doggett, 1992). More details about
calendars and history were provided (Grun, 1979.). Based on the orbital
motions of the solar system, time was introduced (McCarthy & Seidelmann,
2009). Astronimical algorithms are necessary to check the accuracy of calendars
(Verkhovsky, 2011; Meeus, 1999). Before the use of the Gregorian calendar,
the Julian calendar was used. Julian calendar has 365.25 days and leap year was
introduced in 46 BCE (Verkhovsky, 2003). This is significantly different from the
length of a solar year (Verkhovsky, 2011). The Gregorian perpetual calendar was
proposed to the Christian world by Pope Gregory X III in 1582 which is closer
to the length of a solar year (Gregory XIII. 1582).
There is a way to convert Julian calendar dates in AD into Gregorian calendar
dates and vice versa by the use of a table (Nautical almanac offices of the United
Kingdom and United States, 1961)

OBJECTIVES OF THE STUDY

1. To convert October 15, 1582 AD (Gregorian calendar date) into a Julian


calendar date. (Problem 1)
2. To convert February 5, 400 AD (Gregorian calendar date) into a Julian
calendar date. (Problem 2)
3. To convert October 5, 1582 AD (Julian calendar date) into a Gregorian
calendar date. (Problem 3)
4. To convert February 5, 100 AD (Julian calendar date) into a Gregorian
calendar date. (Problem 4)

METHODOLOGY

The ordinal numbers of Julian calendar dates in AD and Gregorian calendar


dates in AD must be equal to having the conversion between the two calendars.

Derivation of algorithm 1 (an algorithm for knowing the ordinal number of


a Julian calendar date)
A Julian calendar date that is in AD was studied. In it were three givens: the
month, the day of the month and the year. The study used the day of the month,
converted the month to its equivalent number of days and converted the year to
29
IAMURE International Journal of Mathematics, Engineering & Technology

its equivalent number of days. The values of the day of the month, the month
and the year were added. All other dates will follow to be correct.
Given: October 3, 1582
Day of the month = 3
Month = October = 273

Notes: Add the days that passed after the month. There is a separate computation
for leap years. February having 28 days was used regardless if it is a leap year. e.g.
March = January (31 days) + February (28 days) = 59
Year 1582 = 1582 × 365 + 1582/4, disregard the fraction – 365

Notes: A year is equal to 365 days unless it is a leap year that has 366 days. (year
times to 365 + year/4, disregard the fraction comes from here.) Year 1 AD is the start
of AD. (- 365 comes from here.)
February 29 is added every leap year. (If the date be a leap year and (January or
February), deduct 1)

Note: Rule for determining leap years


A year is a leap year if it is exactly divisible by 4.

Year 1582 = 577430 + 395 – 365 = 577460


Ordinal Number = Day of the month + Month + Year = 3 + 273 + 577460
= 577736th day

Simplifying, algorithm 1
If the date be a leap year and (January or February), use Formula 1 else use
Formula 2.
Notes: add another day (February 29) during a leap year. The difference (the use
of two formulas) is told here. February 29 is added every leap year. (If the date be a
leap year and (January or February), deduct 1)
Formula 1: Ordinal Number = D + M + Y – 366
Formula 2: Ordinal Number = D + M + Y – 365
Where:
Ordinal Number is the ordinal number of the date.
D is the day of the month.
M is the number of days of the month (January = 0, February = 31,
March = 59, April = 90, May = 120, June = 151, July = 181, August = 212,

30
Vol. 9 · January 2014

September = 243, October = 273, November = 304 and December = 334.).


Y is the number of days of the year (year × 365 + year/4, disregard the
fraction.).

Derivation of algorithm 2 (an algorithm for knowing the ordinal number


of a Gregorian calendar date)

A Gregorian date that is in AD was studied. In it were three givens: the


month, the day of the month and the year. The study used the day of the month,
converted the month to its equivalent number of days and converted the year to
its equivalent number of days. The values of the day of the month, the month
and the year were added. All other dates will follow to be correct.
Given: October 15, 1582
Day of the month = 15
Month = October = 273

Notes: Add the days that passed after the month. There is a separate computation
for leap years. February having 28 days was used regardless if it is a leap year. E.g.
March = January (31 days) + February (28 days) = 59
Year 1582 = 1582 × 365 + 1582/4, disregard the fraction – 1582/100,
disregard the fraction + 1582/400, disregard the fraction – 365

Notes: A year is 365 days unless it is a leap year that has 366 days. (year times to
365 + year/4, disregard the fraction – year/100, disregard the fraction + year/400,
disregard the fraction comes from here.) Year 1 AD is the start of AD. (- 365 comes
from here.)
February 29 is added every leap year. (If the date be a leap year and (January or
February), deduct 1)

Note: Rule for determining leap years


It is called a leap year if it is exactly divisible by four but not exactly divisible
by 100 unless
also exactly divisible by 400.

Year 1582 = 577430 + 395 – 15 + 3 – 365 = 577448


Ordinal Number = Day of the month + Month + Year = 15 + 273 + 577448
= 577736th day

31
IAMURE International Journal of Mathematics, Engineering & Technology

Simplifying, algorithm 2
If the date be a leap year and (January or February), use Formula 3 else use
Formula 4.
Notes: Add another day (February 29) during a leap year. The difference (the use
of two formulas) is told here. February 29 is added every leap year. (If the date be a
leap year and (January or February), deduct 1)
Formula 3: Ordinal Number = D + M + Y – 366
Formula 4: Ordinal Number = D + M + Y – 365
Where:
Ordinal Number is the ordinal number of the date.
D is the day of the month.
M is the number of days of the month (January = 0, February = 31,
March = 59, April = 90, May = 120, June = 151, July = 181, August = 212,
September = 243, October = 273, November = 304 and December = 334.).
Y is the number of days of the year (year × 365 + year/4, disregard the
fraction – year/100, disregard the fraction + year/400, disregard the fraction.).

Derivation of algorithms 3 and 5


Use October 3, 1582 in Algorithm 1 and October 15, 1582 in Algorithm 2
for the date correction

577736th day (Julian calendar date) = 577736th day (Gregorian calendar


date)
It is two days difference when connecting the two calendars.
Notes: Adjustment takes place in the Algorithms 3 and 5. Algorithm 3 is like
Algorithm 1 and Algorithm 5 is like Algorithm 2, provided that the two days difference
is included in the original algorithms.

Algorithm 3 (an algorithm for converting an ordinal number of a


Gregorian calendar date that is in AD into a Julian calendar date)

If the date be a leap year and (January or February), use Formula 5 else use
Formula 6.
Notes: Add another day (February 29) during a leap year. The difference (the use
of two formulas) is told here. February 29 is added every leap year. (If the date be a
leap year and (January or February), deduct 1)

32
Vol. 9 · January 2014

Formula 5: Ordinal Number = D + M + Y – 368


Formula 6: Ordinal Number = D + M + Y – 367
Where:
Ordinal Number is the ordinal number of the date.
D is the day of the month.
M is the number of days of the month (January = 0, February = 31,
March = 59, April = 90, May = 120, June = 151, July= 181, August = 212,
September = 243, October = 273, November = 304 and December = 334.).
Y is the number of days of the year (year ×365 + year/4, disregard the
fraction.).

Algorithm 4 (an algorithm for converting Gregorian calendar dates in AD


into Julian calendar dates in AD)

After knowing the Ordinal number of the Gregorian calendar date using
Algorithm 2, know the Julian calendar date using Algorithm 3.

Algorithm 5 (an algorithm for converting an ordinal number of a Julian


calendar date that is in AD into a Gregorian calendar date)

If the date be a leap year and (January or February), use Formula 7 else use
Formula 8.
Notes: Add another day (February 29) during a leap year. The difference (the use
of two formulas) is told here. February 29 is added every leap year. (If the date be a
leap year and (January or February), deduct 1)
Formula 7: Ordinal Number = D + M + Y – 364
Formula 8: Ordinal Number = D + M + Y – 363
Where:
Ordinal Number is the ordinal number of the date.
D is the day of the month.
M is the number of days of the month (January = 0, February = 31,
March = 59, April = 90, May = 120, June = 151, July = 181, August = 212,
September = 243, October = 273, November = 304 and December = 334.).
Y is the number of days of the year (year × 365 + year/4, disregard the
fraction – year/100, disregard the fraction + year/400, disregard the fraction.).

33
IAMURE International Journal of Mathematics, Engineering & Technology

Algorithm 6 (an algorithm for converting Julian calendar dates in AD into


Gregorian calendar dates in AD)

After knowing the Ordinal number of the Julian calendar date using Algorithm
1, one comprehends Gregorian calendar date using Algorithm 5.

RESULTS

1. To convert October 15, 1582 AD (Gregorian calendar date) into a


Julian calendar date. (Problem 1)
Solution: Use Algorithm 2 to know the Ordinal number of the Gregorian
calendar date and then use Algorithm 3 to know the Julian calendar date.
Algorithm 2: Use Formula 4: Ordinal Number = D + M + Y–365
Ordinal Number = 15 + 273 + 577748 = 577736
Algorithm 3: Use Formula 6 first.
577736 = D + M + Y – 367
578103 = D + M + Y
578103 divided by 365.25 to know the year.
Year = 1582.759754, disregard the fraction
If Formula 5 is used, 578104 = D + M + Y
578104 divided by 365.25 to know the year.
Year = 1582.762491, disregard the fraction
Either formula 5 or 6 produced
Year = 1582
1582 is not a leap year. Formula 6 must be used.
578103 = D + M + (1582 × 365 + 1582/4, disregard the fraction)
578103 = D + M + (577430 + 395)
578103 = D + M + 577825
278 = D+M
Get the month. October is 273. M = October
278 = D+273
Get the day. D = 5
Date = October5, 1582 AD (Julian calendar date)

34
Vol. 9 · January 2014

2. To convert February 5, 400 AD (Gregorian calendar date) into a


Julian calendar date. (Problem 2)
Solution: Use Algorithm 2 to know the Ordinal number of the Gregorian
calendar date and then use Algorithm 3 to know the Julian calendar date.
Algorithm 2: Use Formula 4: Ordinal Number = D + M + Y – 366
Ordinal Number = 5 + 31 + 145731 = 145767
Algorithm 3: Use Formula 6 first.
145767 = D + M + Y – 367
146134 = D + M + Y
146134 divided by 365.25 to know the year.
Year = 400.0930869, disregard the fraction
If Formula 5 is used, 146135 = D + M + Y
146135 divided by 365.25 to know the year.
Year = 400.0958248, disregard the fraction
Either formula 5 or 6 produced
Year = 400
400 is a leap year. Formula 5 or 6 must be used.
Use Formula 5 first.
146135 = D + M + (400 × 365 + 100/4, disregard the fraction)
146135 = D + M + (146000 + 100)
146135 = D + M + 146100
35 = D+M
Get the month. February is 31. M = February
35 = D+31
Get the day. D = 4
Date = February 4, 400 AD (Julian calendar date)
Note: Since the date is a leap year and a February, Formula 5 is used.

3. To convert October 5, 1582 AD (Julian calendar date) into a


Gregorian calendar date. (Problem 3)
Solution: Use Algorithm 1 to know the Ordinal number of the Julian calendar
date and then use Algorithm 5 to know the Gregorian calendar date.
Algorithm 1: Use Formula 2: Ordinal Number = D + M + Y – 365
Ordinal Number = 5 + 273 + 577460 = 577738
Algorithm 5: Use Formula 8 first.
577738 = D + M + Y – 363

35
IAMURE International Journal of Mathematics, Engineering & Technology

578101 = D + M + Y
578101 divided by 365.2425 to know the year.
Year = 1582.786779, disregard the fraction
If Formula 7 is used, 578102 = D + M + Y
578102 divided by 365.2425 to know the year.
Year = 1582.789517, disregard the fraction
Either formula 7 or 8 produced
Year = 1582
1582 is not a leap year. Formula 8 must be used.
578101 = D + M + (1582 × 365 + 1582/4, disregard the fraction –
1582/100, disregard the fraction + 1582/400, disregard the fraction)
578101 = D + M + (577430 + 395 – 15 + 3)
578101 = D + M + 577813
288 = D + M
Get the month. October is 273. M = October
288 = D + 273
Get the day. D = 15
Date = October 15, 1582 AD (Gregorian calendar date)

4. To convert February 5, 100 AD (Julian calendar date) into a


Gregorian calendar date. (Problem 4)
Solution: Use Algorithm 1 to know the Ordinal number of the Julian calendar
date and then use Algorithm 5 to know the Gregorian calendar date.
Algorithm 1: Use Formula 1: Ordinal Number = D + M + Y – 366
Ordinal Number = 5 + 31 + 36159 = 36170
Algorithm 5: Use Formula 8 first.
36195 = D + M + Y – 363
36558 = D + M + Y
36558 divided by 365.2425 to know the year.
Year = 100.0924044, disregard the fraction
If Formula 7 is used, 36559 = D + M + Y
36559 divided by 365.2425 to know the year.
Year = 100.0951423, disregard the fraction
Either formula 7 or 8 produced
Year = 100
100 AD is not a leap year. Formula 8 must be used.
36558 = D + M + (100 × 365 + 100/4, disregard the fraction – 100/100,

36
Vol. 9 · January 2014

disregard the fraction + 100/400, disregard the fraction)


36558 = D + M + (36500 + 25 – 1 + 0)
36558 = D + M + 36524
34 = D + M
Get the month. February is 31. M = February
34 = D + 31
Get the day. D = 3
Date = February 3, 100 AD (Gregorian calendar date)

In summary, the following were recorded:
1. Algorithm 1 produced the desired results for knowing ordinal numbers of
Julian calendar dates.
2. Algorithm 2 produced the desired results for knowing ordinal numbers of
Gregorian calendar dates.
3. Algorithm 3 produced the desired results for converting ordinal numbers of
Gregorian calendar dates that are in AD into Julian calendar dates.
4. Algorithm 5 produced the desired results for converting ordinal numbers of
Julian calendar dates that are in AD into Gregorian calendar dates.
5. Algorithm 4 produced the desired results for converting Gregorian calendar
dates into Julian calendar dates.
6. Algorithm 6 produced the desired results for converting Julian calendar
dates into Gregorian calendar dates.

DISCUSSION

1. Days until A.D. 8. Julian calendar dates before 8 A.D. are proleptic, and do
not necessarily match the dates observed in the Roman Empire. (Nautical
almanac offices of the United Kingdom and United States. 1961)
2. The author used a Julian calendar that has a constant table having leap years
occurring every four years. This is one limitation of the paper.
3. Julian calendar dates January 1, 1 AD and January 2, 1 AD when converted
to Gregorian calendar dates will be in Before Christ (BC) which is not
covered here. This is the second limitation of the paper.
4. BC is not included in the algorithms. This is the third limitation of the
paper.

37
IAMURE International Journal of Mathematics, Engineering & Technology

CONCLUSIONS

Algorithms 1 and 2 are correct to determine the ordinal numbers of dates


with reference to January 1, 1 AD. Algorithms 3 and 5 are correct in converting
ordinal numbers with reference to January 1, 1 AD to their respective dates.
Algorithms 4 and 6 are correct in converting Gregorian calendar dates into Julian
calendar dates and vice versa.

LITERATURE CITED

Doggett, L. E.
2000 “Calendars,” In: P. K. Seidelmann, Ed., Explanatory Supplement to
the Astronomical Almanac, US Naval Observatory, University Science
Books Com-pany, Mill Valley, 1992. Retrieved on July 19, 2014 from
http://goo.gl/f612mX

Gregory, X. I. I. I.
2002 Inter Gravissimas (W. Spenser & RT Crowley, Trans.).International
Organization for Standardization.(Original work published 1582).
Retrieved on July 19, 2014 from http://goo.gl/BiUIxy

Grun, B.
1979 “The Timetables of History: A Horizontal Link-age of People and
Events Based on Werner Stein’s Kulturfahrplan,” Simon and Schuster,
New York. Retrieved on July 19, 2014 from http://goo.gl/tpr61y

McCarthy, D. D. & Seidelmann, P. K.


2009 “TIME from Earth Rotation to Atomic Physics,” Chapter 10 &
11, Wiley-VCH, Weinheim, 2009. doi:10.1002/9783527627943.
Retrieved on July 19, 2014 from http://goo.gl/R2g6B7

Meeus, J. H.
1991 Astronomical algorithms. Willmann-Bell, Incorporated. Retrieved on
July 19, 2014 from http://goo.gl/Z2hiJh

Nautical almanac offices of the United Kingdom and United States


1961 Explanatory Supplement to the Astronomical Ephemeris and the

38
Vol. 9 · January 2014

American Ephemeris and Nautical Almanac  (pp. 411–417). London:


H. M. Stationery Office. Retrieved on 24 May 2011 from http://goo.gl/
oJoaoq

Verkhovsky, B.
2003 Amended Julian Worldwide Calendar.  Annals of European Academy
of Sciences, 330-334. Retrieved on July 19, 2014 from http://goo.gl/
ZexJ56

Verkhovsky, B. S.
2011 Astronomical Algorithms: Amended Multi-millennia Calendar.  Int’l
J. of Communications, Network and System Sciences,  4, 483.
doi:10.4236/ijcns.2011.48059. Retrieved on July 19, 2014 from http://
goo.gl/CcsedX

39

You might also like