Three Calendar Types - Solar, Lunar, Lunisolar
Calendars fall into three categories based on which celestial cycle they prioritize. Solar calendars track Earth's orbit around the sun (about 365.2422 days) and keep the seasons aligned with calendar dates. Lunar calendars track the moon's synodic cycle (about 29.5306 days), giving 12 lunar months a total of about 354 days, drifting through the seasons. Lunisolar calendars compromise: months follow the moon, but extra months are inserted periodically to keep the year tied to the solar cycle.
The Gregorian calendar in international use today is solar. The Islamic (Hijri) calendar is purely lunar, which is why Ramadan shifts about 11 days earlier each Gregorian year. Japan's traditional calendar and China's agricultural calendar are lunisolar, which is why Lunar New Year shifts within a 30-day window each Gregorian year, depending on when the system inserts a leap month.
The Julian Calendar - Caesar's Reform and Its Drift
In 46 BCE, Julius Caesar adopted advice from the Egyptian astronomer Sosigenes and reformed the Roman calendar. The Julian calendar set the year length to 365.25 days with one leap day every four years, approximating the solar year far better than the politically manipulated Roman calendar that preceded it (which had drifted nearly three months from the seasons).
Yet the actual solar year is 365.2422 days, leaving a 0.0078-day (about 11 minutes 14 seconds) excess in the Julian system. The discrepancy accumulated to one day every 128 years, or about 12.5 days by the 16th century. By 1582, the spring equinox fell on March 11 instead of March 21, threatening the calculation of Easter and other liturgical dates that depended on astronomical events.
Pope Gregory XIII issued the calendar reform in 1582. To resolve the accumulated drift, the day after October 4, 1582 became October 15, 1582, deleting 10 calendar days. The leap year rule was also modified: years divisible by 100 are not leap years, except those divisible by 400, which are. This adjustment cut the average year length to 365.2425 days.
The accuracy gain was dramatic: the new system drifts only about one day every 3,236 years from the actual solar year. Catholic countries (Italy, Spain, Portugal) adopted immediately. Protestant countries resisted "the Pope's calendar": Britain switched in 1752, Russia not until 1918 after the revolution, Greece not until 1923. The reform's reception illustrates how political and religious identity shaped what looks like a purely scientific question.
Calendars Still in Active Use
Even with the Gregorian calendar as the international standard, many calendars remain in parallel use for religious and cultural purposes. The Islamic calendar is purely lunar and determines Ramadan and Hajj timing. The Hebrew calendar is lunisolar, inserting seven leap months in a 19-year Metonic cycle to keep Passover aligned with spring.
The Ethiopian calendar runs about 7-8 years behind Gregorian and uses 13 months (12 of 30 days plus a 5- or 6-day month). Thailand's official calendar is the Buddhist Era, which adds 543 to the Gregorian year. These calendars in active use mean that internationalization in software cannot be reduced to translation; date logic must accommodate fundamentally different counting systems.
Calendar Diversity in Software
Date handling in code is more complex than it looks. JavaScript's Intl.DateTimeFormat accepts a calendar option such as 'islamic', 'hebrew', 'chinese', or 'japanese' (Japanese era), letting the same Date object render under different calendars. Java's java.time package provides HijrahChronology, JapaneseChronology, and others as first-class chronologies.
The catch is that month length, year length, and leap rules differ across calendars, so date arithmetic varies. "One month later" in Gregorian can be 28-31 days, but in Islamic it is 29-30 days, and in Ethiopian it is always 30 days. Multi-calendar applications need an abstract date layer that delegates arithmetic to chronology-specific implementations rather than hardcoding Gregorian assumptions throughout the codebase.