If a person breaks his fast thinking that the sun has set, then he finds out that it had not set, he has to make up that day. This is the view of the majority of scholars.
Ibn Qudaamah (may Allaah have mercy on him) said in al-Mughni (4/389):
This is the view of most of the scholars, fuqaha’ and others. End quote.
The Standing Committee was asked about a man who broke his fast based on his two daughters’ saying that the sun had set, then when he went out to pray, he heard the muezzin giving the call for Maghrib prayer.
If you broke your fast after the sun had set, then you do not have to make up that day. But if you find out or you think it most likely or you are not sure whether you broke your fast before the sun set, then you and those who broke their fast with you have to make up that day, because the basic principle is that it was still daytime, and this principle cannot be altered except in accordance with sharee’ah, which in this case means when sunset happens. End quote.
Fataawa al-Lajnah al-Daa’imah, 10/288
Shaykh Ibn Baaz was asked about some people who broke their fast and then found out that the sun had not set. He replied:
The person to whom that happened should refrain from eating and drinking until the sun sets, and he has to make up that day according to the majority of scholars. There is no sin on him if he broke his fast after doing his best to find out whether the sun had set. This is like when a person wakes up during the day on the thirtieth day of Sha’baan, then he finds out during the day that Ramadaan has begun. He should refrain from eating and drinking for the rest of the day, and he should make up that day according to the majority of scholars, and there is no sin on him, because when he ate and drank he did not know that it was Ramadaan. His ignorance of that means that there is no sin on him. As for making it up, he must make it up. End quote.
Majmoo’ Fataawa Ibn Baaz, 15/288
Some scholars are of the view that fasting is valid in this case, and that it is not essential to make it up. This was narrated from Mujaahid and al-Hasan, and it is the view of Ishaaq and of Ahmad according to one report, and of al-Muzani and Ibn Khuzaymah. It was the view favoured by Shaykh al-Islam Ibn Taymiyah, and was regarded as more likely to be correct by Ibn ‘Uthaymeen.
See Fath al-Baari, 4/200; Majmoo’ Fataawa li Shaykh al-Islam, 25/231; al-Sharh al-Mumti’, 6/402-408
They quoted as evidence the hadeeth narrated by al-Bukhaari (1959) from Hishaam ibn ‘Urwah from Faatimah from Asma’ bint Abi Bakr al-Siddeeq (may Allaah be pleased with him) who said: “We broke our fast at the time of the Prophet (peace and blessings of Allaah be upon him) on a cloudy day, then the sun came out.” It was said to Hishaam: Were they commanded to make it up? He said: It has to be made up. Ma’mar said: I heard Hishaam say: I do not know whether they made it up or not.
The words of Hishaam, “It has to be made up” were said by him on the basis of his ijtihaad. He did not say that the Prophet (peace and blessings of Allaah be upon him) commanded them to make it up. Hence al-Haafiz said:
As for the hadeeth of Asma’, it cannot be deduced from it that it should be made up or that it should not. End quote.
Shaykh Ibn ‘Uthaymeen said in al-Sharh al-Mumti’ (6/402):
So they broke their fast during the day based on their assumption that the sun had set but they were unaware not of the shar’i ruling but of the situation. They did not think that it was still daytime. But the Prophet (peace and blessings of Allaah be upon him) did not tell them to make it up; if making it up had been obligatory it would have been the law of Allaah and it would have been known, but since it was not known and was not narrated from the Prophet (peace and blessings of Allaah be upon him), the basic principle is that the duty has been discharged and it does not have to be made up. End quote.
Shaykh al-Islam Ibn Taymiyah said in Majmoo’ al-Fataawa (25/231):
This indicates that it is not obligatory to make it up. If the Prophet (peace and blessings of Allaah be upon him) had told them to make it up, that would have been well known as it is narrated that they broke their fast. Since that was not narrated, this indicates that he did not tell them to do that. If it is said, that it was said to Hishaam ibn ‘Urwah, “Were they commanded to make it up?” and he said, “Is there any other alternative?” – the answer is that Hishaam said that on the basis of his own opinion and did not narrate that in the hadeeth. The fact that he did not have any knowledge of that is indicated by the fact that Ma’mar is reported to have said: I heard Hishaam say: I do not know whether they made it up or not. Both were narrated from him by al-Bukhaari. Hishaam narrated from his father ‘Urwah that they were not commanded to make it up, and ‘Urwah was more knowledgeable than his son.” End quote.
If you want to be on the safe side and make up a day in its place, then you are doing well. Making up one day is a simple matter, praise be to Allaah, and there is no sin on you for what happened.
And Allaah knows best.