Praise be to Allah.
The scholars differed concerning the ruling on one who eats or drinks thinking that it is still night and that dawn has not yet come , and the one who eats or drinks thinking that the sun has set then he finds out that he was mistaken.
Many of the scholars were of the view that this invalidates his fast, and he must fast another day to make up for it.
Others were of the view that his fast is still valid and that he should complete his fast and does not have to make it up. This is the view of Mujahid and al-Hasan among the Tabi'in, it was narrated in one report from Imam Ahmad, and it was the view favoured by al-Muzani among the Shafi`is, and by Shaykh al-Islam Ibn Taymiyah. It was also the view regarded as correct by Shaykh Muhammad ibn al-Salih al-‘Uthaymin (may Allah have mercy on them all).
Shaykh al-Islam Ibn Taymiyah said:
“Those who say that the fast is not broken if a person makes a mistake or forgets at the beginning or end of the day said: our evidence is stronger, and the evidence of the Quran and Sunnah concerning what we say is clearer. Allah says (interpretation of the meaning):
“Our Lord! Punish us not if we forget or fall into error” [al-Baqarah 2:286]
Forgetting and falling into error are mentioned together, because the one who does things that are forbidden in Hajj or prayer by mistake is like one who does them out of forgetfulness. It was proven in al-Sahih that one day at the time of the Prophet (peace and blessings of Allah be upon him) they broke the fast and then the sun appeared, but it does not say in the hadith that they were ordered to make up that fast. But Hisham ibn ‘Urwah said: It must be made up, but his father was more knowledgeable than him and he said, They do not have to make it up. And it was proven in al-Sahihayn that a group of Sahabah used to eat until one of them could distinguish the white thread from the black. The Prophet (peace and blessings of Allah be upon him) said to one of them, “Your pillow is wide [if the white thread (of dawn) and the black thread (of the night) are underneath your pillow], rather that is the whiteness of the day and the blackness of the night.” But it is not narrated that he told them to make up their fasts; they were ignorant of the ruling so they were making a mistake. And it is proven that ‘Umar ibn al-Khattab broke his fast then it became clear that it was still day, but he said, “We will not make it up because we did not deliberately commit sin.” And it was narrated that ‘Umar said: “We will make it up,” but the isnad of the first report is stronger. And it was narrated from him that he said, “It is not a serious matter.” So some of the scholars understood this as meaning that it is not essential to make it up, but the wording does not indicate that.
In conclusion, this view is stronger in terms of reports and reasoning, and is more strongly supported by evidence from the Quran and Sunnah and analogy (qiyas).” (Majmu’ al-Fatawa, 20/572, 573) (See also al-Sharh al-Mumti’, 6/411.)
Hence we can see how strong the evidence is for the view that his fast is valid and he does not have to make it up. However, if the Muslim does that which is on the safe side and fasts a day in its stead, that will be better.
And Allah knows best.