Praise be to Allah.
Islamic teaching has stipulated a clear sign for the end of the fast and the beginning of breaking the fast, which is the setting of the sun below the horizon.
Once the sun sets, it is permissible for the fasting person to break his fast, because Allah, may He be exalted, says (interpretation of the meaning):
“then complete your Saum (fast) till the nightfall”
The night begins when the sun sets, as has been explained previously in the answer to question no. 110407.
The Prophet (blessings and peace of Allah be upon him) said: “When the night comes from here [i.e., the east] and the day departs from here [i.e., the west] and the sun sets, then the fasting person may break his fast.” Narrated by al-Bukhaari (1954) and Muslim (1100)
An-Nawawi (may Allah have mercy on him) said: The fast ends and is completed with the setting of the sun, according to the consensus of the Muslims.
End quote from al-Majmoo‘ Sharh al-Muhadhdhab (6/304)
Ibn ‘Abd al-Barr said: The day during which the fast must be observed lasts from the break of dawn until the setting of the sun. There is consensus among the Muslim scholars on this point.
End quote from at-Tamheed (10/62)
What is meant by sunset is the complete disappearance of the disc of the sun; no attention is to be paid to the red afterglow that remains on the horizon. Once the entire disc has disappeared, then it has become permissible to break the fast.
Al-Haafiz Ibn Rajab said: This hadith indicates that the mere disappearance of the sun’s disc means that the time for Maghrib prayer has begun, and the fasting person may break his fast at that point. This is the consensus of the scholars, as was narrated by Ibn al-Mundhir and others.
Our companions, the Shaafa‘is and others said: No attention is to be paid to the deep red afterglow that remains in the sky after the disc of the sun has disappeared from view.
End quote from Fath al-Baari (4/352)
Shaykh al-Islam Ibn Taymiyah said:
When the disc of the sun has disappeared, at that point the fasting person may break his fast, and the time when offering supererogatory prayers is disallowed has come to an end. The deep red afterglow that may remain on the horizon does not affect any rulings at all.
End quote from Sharh ‘Umdat al-Fiqh (p. 169)
No attention is to be paid to the rays that remain after the sun has set completely; rather the time (for Maghrib prayer) has begun even though the rays remain.
End quote from Majmoo‘ Sharh al-Muhadhdhab (3/29)
If a person is fasting at the time of sunset, one of two scenarios must be applicable:
1. Either he is in a place where it is possible to see the setting of the sun below the horizon, such as if he is in the desert or open ground, or on a mountaintop, or in an elevated place where it is possible to see the sun when it disappears below the horizon.
In this case, he should break his fast when the entire disc of the sun has disappeared.
What matters is the disappearance of the entire disc of the sun, which is what is seen clearly in the desert.
End quote from al-Majmoo‘ (3/29)
2. Or he is in a place where he cannot see the setting of the sun below the horizon – either because he lives in a city where buildings prevent him from seeing the horizon, or because he is in a low-lying place such as a valley, or because there are mountains preventing him from seeing the sun, and so on.
In this case it is not permissible for him to break his fast as soon as the sun disappears from his sight, because it may disappear from his sight before it has actually set, as it has disappeared behind the buildings. In this case he can determine whether it has set by noting the disappearance of its rays on high walls, or by the coming of night from the east – if it is possible to see that. What is meant by the coming of night is the appearance of the darkness of night in the sky from the east; it does not mean the spread of darkness across the entire sky, which occurs some time after sunset.
In the case of built-up or mountainous areas, what matters is that none of the sun’s rays should be visible on the walls or mountain tops, and darkness should be approaching from the east.
End quote from al-Majmoo‘ (3/29)
It says in al-Fawaakih ad-Dawaani (1/168): What the author mentions about the time of Maghrib being when the sun sets is applicable in the case of those who live on mountaintops or in the wilderness.
As for those who live behind the mountains, they should not rely on the disappearance from view of the sun; rather they should rely on the coming of the darkness from the east – when it appears, that is a sign that the sun has set, so they may pray (Maghrib) and break their fast. End quote.
Ibn Daqeeq al-‘Eid said:
Locations vary – in some places there may be something that prevents a person from seeing the disc of the sun, and in that case it is not sufficient to note that the disc has disappeared from view. Such a person should note as the sign of its having set the appearance of the night from the east.
End quote from Ihkaam al-Ahkaam (1/166)
The time of Maghrib is when the disc of the sun disappears in a place in which there are no mountains. As for places in which the sun sets behind mountains, one should look towards the east, and when darkness appears, that is an indication that the sun has set.
End quote from Mawaahib al-Jaleel (1/392)
This is indicated by the hadith quoted above: “When the night comes from here [i.e., the east] and the day departs from here [i.e., the west] and the sun sets, then the fasting person may break his fast.”
Al-Qurtubi said: One of these things implies the other, because the night does not come except when the day departs, and the day does not depart except when the sun sets. But it may be the case that one may not be able to see the sun set with one’s own eyes, but he does see the emergence of darkness, so that he may be certain that the sun has set. At that time it becomes permissible to break the fast.
End quote from Ikmaal al-Mu‘allim (4/35)
An-Nawawi (may Allah have mercy on him) said:
The scholars said: Each one of these three implies the other two. They are only mentioned together because a person may be in a valley and the like, where he cannot see the setting of the sun, so he has to rely on the coming of darkness and the departure of daylight.
End quote from Sharh Saheeh Muslim (7/209)
Ibn Daqeeq al-‘Eid said:
The coming [of darkness] and the departure [of daylight] are interconnected; what I mean is the coming of night and the departure of day.
One of them may be clearer to the eye in some locations, so that which is visible should be taken as proving that which is hidden, such as if there is something towards the west that prevents one from seeing sunset, but the east is open and clear, so one should assume from the onset of night that the sun has set.
End quote from Ihkaam al-Ahkaam (2/27)
Based on that:
It is not permissible for those who live in cities and places in which there is anything that prevents seeing the horizon to break the fast as soon as the sun disappears from view. Rather it is essential to ascertain that the disc of the sun has set below the horizon.
In most cases, it is not possible to observe the sunset in cities, because of the presence of buildings and street lights. Most of the Muslims nowadays rely on timetables, and there is nothing wrong with that, if the organisation that produces them is trustworthy and respected. For more information, please see the answers to questions no. 220838 and 110407
And Allah knows best.