The Ramadan fast was made obligatory in 2 AH, the second year after the Hijra. Traditional Islamic accounts place the formal obligation in Sha'ban of that year, shortly before the first Ramadan fast observed as a required practice by the Muslim community.
The obligation is connected with Quran 2:183–185, especially the instruction that believers fast during the month of Ramadan. Ramadan is the ninth month of the Islamic lunar calendar, and the daily fast runs from dawn until sunset. It requires abstaining from food and drink, along with other acts that invalidate the fast, while cultivating self-restraint and God-consciousness.
The timing matters because Muslims had already practiced forms of fasting, including voluntary fasting associated with Ashura. Once Ramadan fasting became obligatory, it became one of Islam’s Five Pillars. The obligation includes recognized exemptions, such as illness or travel, with missed days generally made up later according to Islamic law.