Gujarati Panchang algorithm: astronomical calculations in Flutter
How we compute accurate Tithi, Nakshatra, and Vikram Samvat timings entirely offline on mobile devices.

Building the Gujarati Calendar required solving a fascinating computational challenge: Hindu calendar systems are lunisolar. Unlike the Gregorian calendar's fixed 30/31 day months, a Tithi depends strictly on the angular distance between the Sun and the Moon.
Mathematical formulation of a Tithi
Each Tithi represents a 12-degree elongation difference between the moon and the sun. Because lunar velocity varies throughout its elliptical orbit, a Tithi can last anywhere from 19 to 26 hours. Computing this on-device without a continuous server dependency required implementing high-precision ephemeris algorithms directly in Dart.
- Solar and lunar ecliptic longitude calculations
- Sunrise and sunset computation based on exact latitude/longitude
- Kshaya (skipped) and Vriddhi (extended) tithi detection
- Paksha (Shukla/Krishna) and Maas (Month) state transitions
By running the panchang engine entirely on client-side Dart code, users in remote villages can open the app and get accurate muhurats with zero internet connectivity.
Related product
Gujarati Calendar
Complete Gujarati Panchang application providing daily Hindu calendar, Choghadiya, Vrat, festivals, and horoscope in Gujarati.
Keep reading
Related articles

Building an offline-first Panchang and Tithi engine
Why regional utility apps must work flawlessly without internet, and how Hive and SQLite enable instant startup times.

Real-time Choghadiya calculation: handling sunrise & sunset accuracy
Dividing daytime and nighttime into eight astrological segments based on accurate local solar ephemeris.

Multilingual audio and text synchronization in Flutter apps
Karaoke-style Sanskrit recitation highlighting with simultaneous multi-language translation streams.