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).
λ_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 = ⌊ ((λ_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.
| Moment | When | Festivals |
|---|---|---|
| Sunrise | local sunrise | Navratri, Dussehra and most others |
| Pradosh | just after sunset | Dhanteras, Diwali (Lakshmi Puja) |
| Aparahna | from 60% of the daylight | Bhai Dooj |
| Moonrise | local moonrise | Karwa Chauth |
| Sunset | local sunset | Chhath (the evening offering) |
What it gives for Delhi in 2026
| Festival | Computed for Delhi | Matches published calendars |
|---|---|---|
| Sharad Navratri begins | 11 October | yes |
| Dussehra | 20 October | yes |
| Karwa Chauth | 29 October | yes |
| Dhanteras | 6 November | yes |
| Diwali | 8 November | yes |
| Govardhan Puja | 10 November | yes |
| Bhai Dooj | 11 November | yes |
| Chhath | 13 to 16 November window | yes |
| Adhik month | Jyeshtha | yes |
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.