Moon and Sun Calendars

Time: Clocks, Calendars and How We Measure It

Course 1 ยท Chapter 3 ยท Fitting months into years

Imagine you are a temple scribe and the harvest festival is meant to fall in the first full Moon after the barley ripens. Count 12 Moon cycles from last year's festival and you arrive about eleven days too early; the barley is still green. Count 13 and you are over a fortnight too late. Time: Clocks, Calendars and How We Measure It 1 put numbers on this clash: a year holds 12.368 months, and no whole number of months fits. This chapter is about the three ways people have answered. Follow the Moon and let the seasons wander, follow the Sun and forget the Moon, or stitch the two together with an occasional extra month.

What was run, and what to trust
Every Python snippet in this chapter and in the three exercise solutions was executed, and the output in the comments is what Python printed. The year, month and 19-year figures are standard values and were calculated in the text. The historical dates (the Egyptian civil calendar, Babylonian regularisation of the 19-year cycle, the fixing of the Hebrew calendar, the start of the Islamic era in 622 CE) are the approximate dates usually given and were written from memory, not looked up again while writing. Treat them as "around then" for the ancient ones. The Hebrew leap-year pattern and the Islamic 30-year pattern are the commonly published ones, but the real calendars have extra rules for month lengths and for the day a year begins that this chapter leaves out.

Three Ways to Build a Calendar

Every calendar has to decide what it is tied to. There are three families, and which one a culture chose still shows in its festivals today.

LunarSolarLunisolar
Tied tothe Moon's phasesthe seasonsboth
Typical year12 months, 354 or 355 daysabout 365 days12 or 13 months, 353 to 385 days
Months match the Moon?yesno, months are just a convenient divisionyes
Year matches the seasons?no, slides through themyes (once leap days are handled)yes, on average
ExamplesIslamic calendarEgyptian civil calendar, and the calendars of Time: Clocks, Calendars and How We Measure It 4Babylonian, Hebrew, Chinese

Lunar Calendars: Follow the Moon, Lose the Seasons

The simplest way to run a month is to let the sky tell you. A new month begins when someone sees the thin crescent of the new Moon after sunset. Because the Moon cycle is 29.53 days, a month is either 29 or 30 days: whichever the sighting says. Twelve such months give a year of 354 or 355 days. That is the whole design, and it works beautifully for the Moon. It does not work for the seasons, as a small calculation shows.

YEAR = 365.2422 MONTH = 29.530589 lunar_year = 12 * MONTH slip = YEAR - lunar_year print("12 lunar months:", round(lunar_year, 3), "days") print("the seasons get ahead by", round(slip, 3), "days a year") print("a full lap of the seasons takes", round(YEAR / slip, 1), "years") # 12 lunar months: 354.367 days # the seasons get ahead by 10.875 days a year # a full lap of the seasons takes 33.6 years

A purely lunar calendar slips back about 10.9 days against the seasons every year. After three years it is a month adrift (3 x 10.875 = 32.6 days), and after 33.6 years the New Year has been through summer, autumn, winter and spring and arrived back where it began (365.2422 / 10.875 = 33.6). Someone born in the first month of the calendar will celebrate birthdays in every season of their life.

The Islamic Calendar: Lunar on Purpose

The Islamic (Hijri) calendar is the main calendar still in use that is purely lunar, and it is lunar by choice. It counts years from the Hijra, the Prophet Muhammad's move from Mecca to Medina, in 622 CE. It has 12 months, and the Quran is generally understood to forbid adding a thirteenth, so the calendar never gets pulled back towards the seasons. The month of Ramadan therefore falls about 11 days earlier each year and, over about 33 years, occurs in every season.

In practice a month begins when the crescent is actually sighted, which depends on weather and place, so the beginning of a month can differ by a day between countries. For planning, tables use a fixed rule: the 30-year tabular calendar. Of every 30 years, 19 have 354 days and 11 have 355 days (leap years are years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29 of the cycle). The arithmetic is short:

YEAR = 365.2422 calendars = {"Egyptian civil": 365, "12 lunar months": 354, "Islamic 30-year cycle": 10631 / 30} for name, length in calendars.items(): slip = YEAR - length print(name, "| slip per year", round(slip, 3), "d | after 100 years", round(slip * 100, 1), "d | full lap", round(YEAR / slip, 1), "years") # Egyptian civil | slip per year 0.242 d | after 100 years 24.2 d | full lap 1508.0 years # 12 lunar months | slip per year 11.242 d | after 100 years 1124.2 d | full lap 32.5 years # Islamic 30-year cycle | slip per year 10.876 d | after 100 years 1087.6 d | full lap 33.6 years

The 30-year cycle holds 19 x 354 + 11 x 355 = 6726 + 3905 = 10631 days, which is 354.367 days a year on average, and 10631 / 360 = 29.5306 days a month: very close to the Moon's 29.5306. Plain 354-day years, with no leap days at all, would drift 0.367 of a day a year against the Moon itself; the tabular calendar holds the Moon to within about a day in 2500 years (Exercise 3). The price of that Moon-accuracy is that the seasons are ignored on purpose. Because the Islamic year is shorter than the solar year, its number grows faster: 1447 AH began in 2025 CE, only about 1403 solar years after 622 CE.

Solar Calendars: the Egyptian Civil Year

The opposite choice is to forget the Moon and count days in a fixed pattern close to the solar year. The classic early example is the Egyptian civil calendar, probably in use by the third millennium BC. Its year was beautifully simple: 12 months of exactly 30 days, then 5 extra days at the end, which makes 12 x 30 + 5 = 365 days. There were no leap days, and the months no longer followed the Moon. The calendar was tied to the Nile, whose yearly flood arrived at about the time Sirius, the brightest star, was first seen rising ahead of the Sun at dawn. That star-rising was the natural New Year marker.

Egypt also kept a lunar calendar alongside for religious festivals, so the picture was not as simple as "solar only". But the civil year was the one used by officials, and it has a built-in flaw: 365 days is 0.2422 of a day too short. The New Year moves one day earlier against the seasons about every four years.

YEAR = 365.2422 # tropical year, days CIVIL = 365 # 12 months of 30 days + 5 extra days for years in (4, 40, 100, 1460): print(years, "years: New Year has slipped", round(years * (YEAR - CIVIL), 1), "days") print("full lap of the seasons:", round(YEAR / (YEAR - CIVIL)), "years") # 4 years: New Year has slipped 1.0 days # 40 years: New Year has slipped 9.7 days # 100 years: New Year has slipped 24.2 days # 1460 years: New Year has slipped 353.6 days # full lap of the seasons: 1508 years

The slip is slow compared with a lunar calendar, so a lifetime hardly notices it: 24 days a century. But over 1500 years it adds up to the whole year, so a festival tied to the civil date would eventually have run through all the seasons. The 1460-year figure often quoted for the full lap comes from rounding the year to exactly 365.25 days, where 365 / 0.25 = 1460. With the better value, 365.2422, the lap is 1508 years. Fixing this drift needed a leap day, and that story, including the Roman and Gregorian fixes, is in Time: Clocks, Calendars and How We Measure It 4.

Lunisolar Calendars: Stitching Moon and Sun Together

The third answer keeps both: months that follow the Moon and a year that follows the seasons. Because 12 months fall short and 13 overshoot, you use 12 most years and 13 in some. The extra month is called an intercalary month (from the Latin for "to proclaim a day inserted"). The art is in choosing which years get it.

Babylon. The earliest Babylonian calendars decided the matter by observation and decree: priests watched the sky and the state of the crops, and the king announced when an extra month was to be added. Later the decisions became rule-based. By around 500 BC the Babylonians had settled on a 19-year pattern with 7 extra months. The same near-match was found in Greece and is often named after Meton of Athens (around 432 BC): the Metonic cycle. It is the 19-year fit that the exercise in Time: Clocks, Calendars and How We Measure It 1 uncovered by searching.

YEAR = 365.2422 MONTH = 29.530589 print("19 years =", round(19 * YEAR, 3), "days; 235 months =", round(235 * MONTH, 3), "days") print("gap:", round(235 * MONTH - 19 * YEAR, 3), "days") # 19 years = 6939.602 days; 235 months = 6939.688 days # gap: 0.087 days

Nineteen years of 12 months make 19 x 12 = 228 months. To reach 235 you need 235 - 228 = 7 extra months, so 7 of every 19 years get 13 months. Over the whole cycle the lunar and solar calendars agree to within 0.087 of a day (about two hours), so the pattern can repeat for centuries before it needs a correction. Which 7 years? A simple rule is: add a month whenever twelve months would end more than half a month too early. Let us try it:

YEAR = 365.2422 MONTH = 29.530589 offset = 0.0 # lunar year end minus solar year end, in days for year in range(1, 20): months = 12 if offset + 12 * MONTH - YEAR < -MONTH / 2: # twelve months would end over half a month early months = 13 offset += months * MONTH - YEAR print("year", year, "months", months, "offset", round(offset, 2), "d") # year 1 months 12 offset -10.88 d # year 2 months 13 offset 7.78 d # year 3 months 12 offset -3.09 d # year 4 months 12 offset -13.97 d # year 5 months 13 offset 4.69 d # year 6 months 12 offset -6.19 d # year 7 months 13 offset 12.47 d # year 8 months 12 offset 1.59 d # year 9 months 12 offset -9.28 d # year 10 months 13 offset 9.37 d # year 11 months 12 offset -1.5 d # year 12 months 12 offset -12.38 d # year 13 months 13 offset 6.28 d # year 14 months 12 offset -4.6 d # year 15 months 13 offset 14.06 d # year 16 months 12 offset 3.18 d # year 17 months 12 offset -7.69 d # year 18 months 13 offset 10.96 d # year 19 months 12 offset 0.09 d

Seven years get 13 months (years 2, 5, 7, 10, 13, 15 and 18), exactly the 7 the arithmetic demanded, and the offset never strays beyond about 14 days either way before it lands on 0.09 after 19 years. A calendar like this never gets more than half a month out of step with the seasons, which is good enough to keep a spring festival in spring.

The Hebrew calendar. The Hebrew calendar uses exactly this 19-year cycle. Its leap years are the 3rd, 6th, 8th, 11th, 14th, 17th and 19th of every cycle, and the thirteenth month is added as an extra "Adar" before the usual one. Early on, the Sanhedrin in Palestine announced each year's decision from observation; the calendar was set to a fixed, calculated form in the fourth century CE (traditionally around 359 CE), so that communities far from any authority could work out the dates themselves. The Chinese calendar is another lunisolar one, with a leap month placed by an astronomical rule rather than a fixed 19-year pattern.

Notice that the Hebrew pattern (3, 6, 8, 11, 14, 17, 19) is not the same as the one our simple rule produced (2, 5, 7, 10, 13, 15, 18). Both give 7 leap years in 19. The traditional pattern spaces the extra months a little differently, and Exercise 2 compares them.

Why Is a Year 365.2422 Days?

Nothing in physics says a year has to be a certain number of days. The number is measured, not derived: the Earth's trip around the Sun and its spin on its axis are independent motions that happen to give this ratio today. The tropical year is the time from one March equinox to the next (more exactly, the time for the seasons to go once round). It is about 365.2422 days, or 365 days plus 0.2422 of a day:

YEAR = 365.2422 SIDEREAL = 365.256363 extra = YEAR - 365 hours = extra * 24 minutes = (hours % 1) * 60 seconds = (minutes % 1) * 60 print(int(hours), "h", int(minutes), "min", round(seconds), "s beyond 365 days") gap_min = (SIDEREAL - YEAR) * 24 * 60 print("sidereal minus tropical:", round(gap_min, 1), "minutes") print("precession cycle:", round(360 * 3600 / 50.29), "years") print("check:", round(SIDEREAL / (1 + 1 / 25772), 4)) # 5 h 48 min 46 s beyond 365 days # sidereal minus tropical: 20.4 minutes # precession cycle: 25771 years # check: 365.2422

So a year is 365 days 5 hours 48 minutes and 46 seconds. There is a second kind of year, too. The sidereal year is one orbit measured against the stars, about 365.2564 days, which is 20.4 minutes longer. The difference comes from precession: the Earth's axis wobbles slowly like a spinning top, once in about 25,800 years (360 degrees in 360 x 3600 arc-seconds, at about 50.3 arc-seconds a year gives 25,771 years). The equinox point creeps backwards along the Sun's path, so the Sun gets back to the equinox slightly before it gets back to the same stars. Calendars want the seasons to stay put, so they follow the tropical year, not the sidereal year. Had a calendar used the sidereal year, the seasons would move through it by one day every 70 years or so.

Because the figure is a messy fraction, every solar calendar has to carry the extra 0.2422 of a day somewhere. The 19-year trick above is the lunisolar way of hiding the fraction. For a solar calendar the fix is a leap day inserted from time to time, which is the subject of Time: Clocks, Calendars and How We Measure It 4.

Common mistakes
Treating "lunar" and "lunisolar" as the same thing (the Islamic calendar has no leap month and drifts through the seasons; the Hebrew and Chinese calendars do not); assuming the Egyptian civil calendar had leap years (it did not, so its New Year drifted); forgetting that 19 years is 7 leap years of 13 months and 12 ordinary ones, not 19 years of 12 months; confusing the tropical year (the seasons, 365.2422 days) with the sidereal year (the stars, 365.2564); and quoting the 1460-year Egyptian cycle without noting that it assumes a year of exactly 365.25 days.
Exercise 1

The Egyptian civil year has 12 x 30 + 5 = 365 days. Find how far its New Year slips against the seasons each year, how many years it takes to slip one season (a quarter of a year), and how many to slip all the way round, using 365.2422 and then exactly 365.25. Compare each result with a purely lunar year of 12 months.

๐Ÿ“„ View solution
Exercise 2

Compare two ways of choosing the 7 leap years in each 19: the fixed pattern 3, 6, 8, 11, 14, 17, 19 and the "add a month when twelve months would end more than half a month early" rule. For each, print the leap years and the range of the lunar-minus-solar offset over one cycle. Then repeat for 1000 years and report the worst offset reached.

๐Ÿ“„ View solution
Exercise 3

Build the 30-year tabular Islamic calendar (leap years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29 have 355 days, the rest 354). Find the days in a cycle, the average month and how many years pass before it is a day out from the true month of 29.530589 days. Then estimate the Gregorian year in which 1, 100, 1000 and 1447 AH began.

๐Ÿ“„ View solution

Quick Reference

  • Lunar calendar: 12 months of 29 or 30 days, 354 or 355 per year; slips about 10.9 days a year against the seasons, a full lap in about 33.6 years
  • Islamic calendar: purely lunar, counted from 622 CE; 30-year table with 11 leap years of 355 days = 10631 days
  • Egyptian civil year: 12 x 30 + 5 = 365 days, no leap days; New Year slips 1 day per 4 years, a full lap in about 1508 years (1460 if the year is taken as 365.25)
  • Lunisolar: 12 or 13 months; 19 years = 235 months = 228 + 7, matching to 0.087 days; Babylonian, Hebrew and Chinese calendars
  • Hebrew leap years: years 3, 6, 8, 11, 14, 17 and 19 of each 19-year cycle
  • Tropical year: 365.2422 days = 365 d 5 h 48 min 46 s; the sidereal year (365.2564 d) is 20.4 minutes longer because of precession
Coming next
Time: Clocks, Calendars and How We Measure It 4 is about the calendar most of the world uses: the Roman muddle, the Julian leap-year reform, the drift that built up, and the Gregorian correction of 1582 that finally brought the leap-year rule to its modern form.