Hadithcore
Sahih al-Bukhari, 1629
sahih

Narrated `Abdullah:

I heard the Prophet (ﷺ) forbidding the offering of prayers at the time of sunrise and sunset.

حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ، حَدَّثَنَا أَبُو ضَمْرَةَ، حَدَّثَنَا مُوسَى بْنُ عُقْبَةَ، عَنْ نَافِعٍ، أَنَّ عَبْدَ اللَّهِ ـ رضى الله عنه ـ قَالَ سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم يَنْهَى عَنِ الصَّلاَةِ عِنْدَ طُلُوعِ الشَّمْسِ وَعِنْدَ غُرُوبِهَا‏.‏

References2 variants
In-Book Reference
Book 25, Hadith 113
USC-MSA web (English) reference
Vol. 2, Book 26, Hadith 695 (deprecated numbering scheme)
Sharh · explanationclick to expand
The Prophet ﷺwas eager in protecting the creed of the Muslims, hence, he ﷺprohibited prayers at specific times; to refrain from emulating the polytheists who prostrate to the sun. In this hadeeth, ‘Abdullah bin ‘Umar (ra) reports that the Prophet ﷺprohibited from pursuing the prayers at the time of sunrise and sunset, especially the voluntary prayers. With that said, a person should not offer prayers at the time of sunrise until the sun rises to the length of a spear which is nearly equivalent to a quarter or one third of the full hour. Also, one should not perform prayers at the time of sunset until the sun is fully set, that is, ten minutes before maghrib until the time of the Maghrib prayers enters. In general terms, the prohibition is at the sunrise and sunset and the times that are closer to them, because that is the time in which sun-worshippers prayed and because it is the time in which the Satan gets closer to the sun and thus it becomes between his two horns. This prohibition, however, is specific to the voluntary and supererogatory prayers and not the obligatory ones, such as one who delays his ‘Asr to that time. In that respect, he can pray at the time of prohibition. It is said that the prohibition of offering prayers at these specific times refers to postponing the obligatory prayers for no excuse, to the extent that it is prayed closer to the sunrise or sunset. From the benefits that can be concluded from this hadeeth is learning about the forbidden prayer times..