Niyyah (intention) is a required condition in fard (obligatory) fasts, and in other obligatory fasts such as making up missed fasts or fasts done as an act of expiation (kafaarah), because the Prophet (peace and blessings of Allaah be upon him) said: "There is no fast for the person who did not intend to fast from the night before." (Reported by Abu Dawood, no. 2454. A number of the scholars, such as al-Bukhaari, al-Nisaa'i, al-Tirmidhi and others thought it was likely to be mawqoof. See Talkhees al-Hubayr, 2/188)
The intention may be made at any point during the night, even if it is just a moment before Fajr. Niyyah means the resolution in the heart to do something; speaking it aloud is bid’ah (a reprehensible innovation), and anyone who knows that tomorrow is one of the days of Ramadaan and wants to fast has made the intention. (Majmoo’ Fataawa Shaykh al-Islam, 25/215). If a person intends to break his fast during the day but does not do so, then according to the most correct opinion, his fast is not adversely affected by this; he is like a person who wants to speak during the prayer but does not speak. Some of the scholars think that he is not fasting as soon as he stops intending to fast, so to be on the safe side, he should make up that fast later on. Apostasy, however, invalidates
the intention; there is no dispute on this matter.
The person who is fasting Ramadaan does not need to repeat the intention every night during Ramadaan; it is sufficient to have the intention at the beginning of the month. If the intention is interrupted by breaking the fast due to travel or sickness – for example – he has to renew the intention to fast when the reason for breaking the fast is no longer present.
Making the intention the night before is not a condition of general nafl (supererogatory) fasts, because of the hadeeth narrated by ‘Aa’ishah (may Allaah be pleased with her), who said: "The Messenger of Allaah (peace and blessings of Allaah be upon him) entered upon me one day and said, ‘Do you have anything [food]?’ We said, ‘No.’ He said, ‘In that case I am fasting.’" (Reported by Muslim, 2/809, ‘Abd al-Baaqi). But in the case of specific nafl fasts such as ‘Arafaah and ‘Aashooraa’, it is better to be on the safe side and make the intention the night before.
If a person embarks on an obligatory fast, such as making up for a day missed in Ramadaan, or fulfilling a vow, or fasting as an act of expiation (kafaarah), he must complete the fast, and he is not permitted to break it unless he has a valid excuse for doing so. In the case of a naafil fast, "the person who is observing a voluntary fast has the choice either to complete the fast or to break it" (reported by Ahmad, 6/342) – even if there is no reason to break it. The Prophet (peace and blessings of Allaah be upon him) got up fasting one morning, then he ate. (As reported in Saheeh Muslim, in the story of the al-hais (a type of food) that was given to him as a gift when he was in ‘Aa’ishah’s house; no. 1154, ‘Abd al-Baaqi). But will the person who breaks his fast for no reason be rewarded for the fasting that he has already done? Some of the scholars say that he will not be rewarded (al-Mawsoo’ah al-Fiqhiyyah, 28/13), so it is better for the person who is observing a voluntary fast to complete it, unless there is a valid, pressing reason for him to stop fasting.
If a person does not know that Ramadaan has started until after dawn, he has to stop eating and drinking for the rest of the day, and he has to make that day up later on, according to the majority of scholars, because the Prophet (peace and blessings of Allaah be upon him) said: "There is no fasting for the one who does not have the intention to fast from the night before." (Reported by Abu Dawood, 2454).
If a prisoner or captive knows that Ramadaanhas begun by sighting the moon himself or by being told by a trustworthy person, he has to fast. If he does not know when the month is beginning, he must try to work it out for himself (ijtihaad) and act according what he thinks is most likely. If he later finds out that his fasting coincided with Ramadaan, this is fine according to the majority of scholars, and if his fasting came after Ramadaan, this is fine according to the majority of fuqahaa’, but if his fasting came before Ramadaan, this is not acceptable, and he has to make up the fast. If part of his fasting coincided with Ramadaan and part of it did not, what coincided with it or came after it is fine, but what came before is not OK. If the matter never becomes clear to him, then his fasting is fine because he did the best he could, and Allaah burdens not a person beyond his scope. (Al-Mawsoo’ah al-Fiqhiyyah, 28/84).