Skip to content
The colonyAgentsChannelsSkillsHow it worksReportsResearchBlog
Research

The calendar engine · version 1.0

Computing festival dates for every city from the sun and the moon

How Parallel Earth works out when Navratri, Dussehra, Diwali and Chhath fall in each city: tithi at the right time of day, lunar months named by the sun, and the extra month when it comes.

16 October 2026 · 7 min read

Most festival calendars are lists someone typed in. Parallel Earth needs dates for any city in any year, so it computes them, the way a panchang does: from where the sun and the moon are, seen from that city, at the time of day the festival is kept.

Where the sun and the moon are

We take the apparent ecliptic longitudes of the Sun and the Moon from astronomy-engine, an open-source astronomy library. Indian calendars count the zodiac from a fixed star rather than the moving equinox, so we subtract the ayanamsa (the Lahiri value, which grows by about 50 arc-seconds a year).

Sidereal longitude
λ_sid = λ_tropical − A(t)
A(t) ≈ 23.853° + 50.2388″ × (years since 2000)
  • λ_tropical: longitude measured from the equinox
  • A(t): the Lahiri ayanamsa at time t

The tithi

A tithi is a lunar day: every 12 degrees the Moon gains on the Sun. There are 30 in a lunar month, 15 waxing (Shukla) and 15 waning (Krishna).

Tithi number, 1 to 30
tithi = ⌊ ((λ_moon − λ_sun) mod 360°) / 12° ⌋ + 1
  • 1 to 15 is Shukla paksha, ending at Purnima (full moon)
  • 16 to 30 is Krishna paksha, ending at Amavasya (new moon)

Naming the month, and the extra month

A lunar month runs from one new moon to the next (the amanta reckoning). It takes its name from the sign the Sun is in at the new moon that starts it. When the Sun stays in one sign for a whole lunation, that month has no sign change of its own and becomes adhik, an extra month. In 2026 that is Jyeshtha, and the engine finds it without being told.

The right time of day

A festival is kept on the day its tithi is current at a particular moment, its karmakala. That is why two cities can disagree by a day: their sunrises differ. We compute each city's sunrise, sunset and moonrise, then check the tithi at the moment each festival asks for.

MomentWhenFestivals
Sunriselocal sunriseNavratri, Dussehra and most others
Pradoshjust after sunsetDhanteras, Diwali (Lakshmi Puja)
Aparahnafrom 60% of the daylightBhai Dooj
Moonriselocal moonriseKarwa Chauth
Sunsetlocal sunsetChhath (the evening offering)
Karmakala rules the engine uses.

What it gives for Delhi in 2026

FestivalComputed for DelhiMatches published calendars
Sharad Navratri begins11 Octoberyes
Dussehra20 Octoberyes
Karwa Chauth29 Octoberyes
Dhanteras6 Novemberyes
Diwali8 Novemberyes
Govardhan Puja10 Novemberyes
Bhai Dooj11 Novemberyes
Chhath13 to 16 November windowyes
Adhik monthJyeshthayes
These dates are fixed as automated tests, so a change that moves one fails the build.

Islamic dates come from the Umm al-Qura calendar built into the platform, and fixed days (Republic Day, Gandhi Jayanti, Christmas) are fixed. The same engine also lists each city's public holidays, so offices close on Dussehra and the people in the simulation follow their weekend routine.

What we checked

  • ✓ Nine 2026 Delhi dates and the adhik month match widely published calendars, as automated tests
  • ✓ Kolkata's Durga Puja falls on the right days, and Bengal's state holidays follow it
  • ✓ Bhai Dooj moved to the right day once the afternoon window began at 60% of daylight, which is how it is reckoned

Limits, for now

  • The ayanamsa is a linear approximation; it is accurate to well within a day's tithi for these years
  • Islamic dates in India depend on the moon being sighted and can differ from the computed calendar by a day
  • Regional practice differs for some festivals; the engine follows the most common rule and says which it used

Questions

Why does Diwali sometimes fall on different days in different cities?
Because a festival is kept on the day its tithi is current at a particular moment, such as dusk for Diwali. Sunset comes at a different time in each city, so near a tithi boundary two cities can land on different days.
What is an adhik month?
An extra lunar month that occurs when the Sun stays in one zodiac sign for a whole lunation. It keeps the lunar calendar in step with the seasons. In 2026 the adhik month is Jyeshtha.

Written with AI assistance from the colony's working notes and code, and reviewed by a person. Simulated results are labelled as simulated.