How BS ↔ AD conversion works
Bikram Sambat is a sidereal solar calendar. A month begins when the Sun enters the next 30-degree sign, so BS months run 29 to 32 days and the year begins in mid-April rather than in January.
There is no formula: the month lengths are published year by year, and conversion is a day count against that published table.
Why BS dates cannot be calculated
A Gregorian month length follows a rule you can write down. A Bikram Sambat month length does not: it depends on how long the Sun spends in a sign that year, which varies. The lengths are determined and published annually by the Nepal Panchanga Nirnayak Samiti, and every Nepali calendar — printed or digital — works from that published table.
Baishakh 31, Jestha 31, Aashadha 32, Shrawan 31, Bhadra 31, Ashwin 31, Kartik 30, Mangsir 29, Paush 30, Magh 29, Falgun 30, Chaitra 30 — the twelve month lengths of 2083 BS. Another year has a different set.
How this calendar converts
- The table anchors at BS 2000-01-01, which is 1943-04-14.
- Any BS date is turned into a day count by summing the published month lengths before it.
- That day count is added to the anchor to give the Gregorian date; the reverse runs the same way backwards.
- Both directions use one implementation. Nothing in the application does its own date arithmetic, so the converter and the calendar grid cannot disagree.
How it is checked
- All 36,891 days are converted in both directions and compared against the published calendar. A single disagreement fails the build.
- The dataset is checked for duplicate dates, missing dates, impossible month lengths, malformed metadata and broken search-index entries.
- Round-trip properties are tested: converting BS → AD → BS, and AD → BS → AD, must return the original date for every date in the table.
- Years whose length a solar year cannot have are reported as warnings rather than silently corrected — BS 2087 and BS 2096 are projections, and this calendar reproduces them as published.