During the entire month of Ramadan, Muslims are obligated to fast (Arabic: صوم, sawm), every day from dawn to sunset. Fasting requires the abstinence from food, drink and sexual activity. Fasting the month of Ramadān was made obligatory (wājib) during the month of Sh’abān, in the second year after the Muslims migrated from Makkah to Madīnah. Fasting the month of Ramadan is one of the five pillars of Islam, as shown by a quote from the Companion Abdullah ibn Umar ibn al-Khattab: "I heard the Messenger of Allah (Allah bless him and give him peace) say: 'The religion of Islam is based upon five (pillars): testifying that there is no deity except God and Muhammad is the Messenger of God; establishing the prayer; giving zakat; making pilgrimage; and fasting (the month) of Ramadan.'" [Bukhari; Muslim]
Fasting during the month of Ramadan is specifically mentioned in three consecutive verses of the Qur'an:
O ye who believe! Fasting is prescribed to you as it was prescribed to those before you, that ye may (learn) self-restraint.
(Fasting) for a fixed number of days; but if any of you is ill, or on a journey, the prescribed number (Should be made up) from days later. For those who can do it (With hardship), is a ransom, the feeding of one that is indigent. But he that will give more, of his own free will,- it is better for him. And it is better for you that ye fast, if ye only knew.
Eating, drinking, and sexual relations are not allowed between dawn (fajr), and sunset (maghrib). Fasting is considered an act of deeply personal worship in which Muslims seek a raised level of closeness to God.
During Ramadan, Muslims are also expected to put more effort into following the teachings of Islam by refraining from violence, anger, envy, greed, lust, angry/sarcastic retorts, gossip, and are meant to try to get along with each other better than normal. All obscene and irreligious stimuli are to be avoided as purity of both thought and action is important.
Fasting during Ramadan is not obligatory for several groups for whom it would be excessively problematic. According to the Qur'an, if fasting would be dangerous to an individual's health such as those with a medical condition or the aged, they are excused.