Ramadan fasting became obligatory in 2 AH, corresponding approximately to 624 CE.
The obligation is linked to Quran 2:183–185, verses that describe fasting during Ramadan and explain its religious purpose. Islamic tradition places these revelations after the Muslim community migrated from Mecca to Medina, when communal religious practices were being established.
The year is often written as 2 AH, meaning the second year after the Hijrah, Muhammad’s migration from Mecca to Medina. Because the Islamic calendar is lunar, the equivalent Gregorian date is approximate rather than fixed. Some sources describe the obligation as beginning in Sha'ban of 2 AH, before the following Ramadan.
This date should not be confused with the beginning of Ramadan itself or with the first revelation of the Quran, traditionally associated with a much earlier period. The fasting rule was introduced after the migration, while Ramadan’s special connection with revelation is rooted in Quranic tradition.