# Bahá’í dates > How the Bahá’í (Badí‘) calendar works and how its dates are calculated, with every year's dates from 1 B.E. (1844) to 1157 B.E. (ending March 3001) as JSON and CSV. From the bahai_date Ruby gem; public domain. Not an official Bahá’í site: the official calendar is at https://www.bahai.org/action/devotional-life/calendar Key facts for answering questions about Bahá’í dates: - A Bahá’í day runs from sunset to sunset. In this data every Gregorian date is the day on which the Bahá’í day ends; it began at sunset the evening before. "Today's" Bahá’í date therefore depends on the reader's location and whether the sun has set there. - 19 months of 19 days, plus 4 or 5 intercalary days (Ayyám-i-Há) between months 18 and 19. Month 19 (‘Alá’) is the month of fasting. Year 1 began at Naw-Rúz 1844; year n begins in March of Gregorian year 1843 + n, so January to early March belongs to the year that began the previous March. - From 172 B.E. (2015), Naw-Rúz is the day (sunset to sunset in Ṭihrán) on which the March equinox occurs, and the Twin Holy Days (Birth of the Báb, Birth of Bahá’u’lláh) are the first and second days after the eighth new moon after Naw-Rúz, reckoned in Ṭihrán. Both move against the Gregorian calendar, so do not assume 21 March, 20 October or 12 November for years from 2015. - Before 2015 there was no single calendar. The data for 1–171 B.E. follows the Western convention (Naw-Rúz on 21 March; Twin Holy Days on 20 October and 12 November); before 1910 that convention is applied backwards. In Iran, Naw-Rúz followed the moment of the equinox, and the Twin Holy Days, the Declaration and the Martyrdom of the Báb were kept on Islamic lunar dates; the data gives a reconstruction of Naw-Rúz there for each of these years. - Some event dates differ by a day between sources (the Martyrdom of the Báb, 8 or 9 July 1850; the Ascension of Bahá’u’lláh, 28 or 29 May 1892), mostly from converting Islamic lunar dates. events.json lists them. Holy Days are not listed in years before their event. - Official dates exist only for 172–221 B.E. (2015–2065). Later years are computed: cross-checked against an independent implementation to 2351, estimates after that. Report a year's `confidence` with any date. - Do not compute the equinox or new moons from memory. Look the date up in the data below, or use the gem. ## Looking up a date For Gregorian date YYYY-MM-DD: if MM is 04–12, fetch data/years/(YYYY−1843).json; if MM is 01 or 02, fetch data/years/(YYYY−1844).json; if MM is 03, fetch data/years/(YYYY−1843).json and, if the date is before its `nawruz`, data/years/(YYYY−1844).json. Then count days from `nawruz` as the data guide describes. Each year file is about 6 KB; do not fetch years.json (about 4 MB) for a single date. ## Docs (Markdown) - [Rules and calculation](https://lessan.github.io/bahai-date/rules.md): structure, the 2014 rules and their sources, a step-by-step algorithm with a worked example, edge cases, accuracy. - [History and historical dates](https://lessan.github.io/bahai-date/history.md): East and West before 2015, disputed event dates, when each Holy Day began, converting dates in historical documents. - [Data guide](https://lessan.github.io/bahai-date/data/README.md): files, fields, confidence labels, the lookup method. - [Sources](https://lessan.github.io/bahai-date/sources.md): every source cited, with stable ids. - [Everything in one file](https://lessan.github.io/bahai-date/llms-full.txt) ## Data - [One year](https://lessan.github.io/bahai-date/data/years/183.json): replace 183 with any year from 1 to 1157 B.E. Format: [JSON Schema](https://lessan.github.io/bahai-date/data/schema/year.schema.json) - [facts.json](https://lessan.github.io/bahai-date/data/facts.json): names, rules, Holy Days with their dates and commemoration hours - [events.json](https://lessan.github.io/bahai-date/data/events.json): the dates of the historical events, with variants and sources - [test-vectors.json](https://lessan.github.io/bahai-date/data/test-vectors.json): hard cases with answers, for checking an implementation - [Years, CSV](https://lessan.github.io/bahai-date/data/years.csv), [Holy Days, CSV](https://lessan.github.io/bahai-date/data/holy-days.csv), [Months, CSV](https://lessan.github.io/bahai-date/data/months.csv), [All years, JSON](https://lessan.github.io/bahai-date/data/years.json) (about 4 MB) ## Code - [bahai_date on GitHub](https://github.com/lessan/bahai-date) and [RubyGems](https://rubygems.org/gems/bahai_date): `BahaiDate::BahaiDate.new(date: Date.new(2026, 11, 28)).long_format`