Most calendars in the world begin from a birth, a reign or a founding. The Islamic calendar begins from an act of sacrifice and trust: the Hijrah, the migration of the Prophet Muhammad ﷺ and his companions from Makkah to Madinah in 622 CE. This article explains the event, why it became the starting point of the calendar, and how the Hijri year works.
The Hijrah in brief
After years of persecution in Makkah, the Muslims were permitted to migrate to Madinah, where many of its people had accepted Islam and pledged to protect the Prophet ﷺ. Many companions left first. The Prophet ﷺ left later with Abu Bakr (may Allah be pleased with him). The Quran refers to the moment when the two were in the cave and the Prophet ﷺ reassured his companion that Allah was with them (Quran 9:40). After the journey they reached Madinah, where the Muhajirun (migrants from Makkah) were received by the Ansar (the helpers of Madinah), and strong bonds of brotherhood were formed.
The Hijrah is not remembered as an escape alone. It marked the beginning of the community's life in Madinah, with the mosque, the community's institutions and the revelations about its social life. The principle of sincere intention found in the migration is also the context of the hadith on intentions.
How the calendar was set
The Muslims did not use a numbered year-count during the Prophet's lifetime; years were identified by notable events. Historical sources report that during the caliphate of Umar ibn al-Khattab (may Allah be pleased with him) the need for a dated system arose in administrative correspondence. Umar consulted the companions on where to begin. Several options were discussed, including the Prophet's birth, the first revelation and his death, and the community settled on the Hijrah, since it marked the point from which truth and falsehood were distinctly separated, according to the commonly cited explanation.
Note the detail that the first day of the calendar is the first of Muharram, the beginning of that lunar year, not the day the migration took place. Historians' accounts of these deliberations vary slightly in wording, so treat the exact reasons as reported by early historians rather than as a legal ruling.
A purely lunar year
The Quran states that the number of months with Allah is twelve (Quran 9:36). The Islamic calendar follows the moon: each month begins with the sighting of the new crescent and lasts 29 or 30 days. A Hijri year is therefore about 354 or 355 days, roughly ten to eleven days shorter than a solar year. As a result, Ramadan and Hajj move through the seasons over the years.
The twelve months
- Muharram
- Safar
- Rabi' al-Awwal
- Rabi' al-Thani
- Jumada al-Ula
- Jumada al-Thaniyah
- Rajab
- Sha'ban
- Ramadan
- Shawwal
- Dhu al-Qa'dah
- Dhu al-Hijjah
The four sacred months
Surah al-Tawbah, in the same verse that mentions the twelve months, says that four of them are sacred. A hadith in Sahih al-Bukhari (e.g. no. 3197) identifies them as Dhu al-Qa'dah, Dhu al-Hijjah and Muharram, which come in succession, and Rajab, which stands alone between Jumada and Sha'ban. Fighting and wrongdoing are especially emphasized as forbidden in these months, and many scholars encourage extra devotion in them.
Where scholars differ: sighting or calculation?
A well-known difference of opinion concerns how to begin the months, especially Ramadan and the two Eids:
- Local or global sighting. Some scholars hold that each locality follows its own sighting, while others hold that one sighting binds the whole community.
- Calculation. Some contemporary scholars and councils permit astronomical calculation, particularly to rule out an impossible sighting. Others insist that the hadith's instruction to fast on sighting the crescent requires actual observation.
These are matters of ijtihad; Muslims typically follow the guidance of their local scholars or religious authority, so the best approach is to follow reputable guidance in your own country and keep unity.
Why it still matters
- The calendar dates Ramadan, Hajj, the two Eids and the days of fasting.
- It reminds Muslims of a founding lesson: sacrifice for faith, and the community built on brotherhood.
- Many countries use the Hijri calendar alongside the Gregorian for religious and civil purposes. If you work with dates in software, remember to use a library that supports the Islamic calendar and its regional variants; for .NET, see
HijriCalendarandUmAlQuraCalendarin the Microsoft documentation.
Closing note
This article gives a general overview drawn from the Quran, hadith and standard historical accounts. For religious rulings, such as starting Ramadan, follow your local qualified scholars.
References
- Quran 9:40 (Quran.com)
- Quran 9:36 (Quran.com)
- Sahih al-Bukhari, the hadith on the sacred months (no. 3197)
- Microsoft Learn: HijriCalendar class