Yahya related to me from Malik from Zayd ibn Aslam from Ata ibn Yasar from Abdullah as-Sunabihi that the Messenger of Allah ﷺ said, "The sun rises and with it is a horn of Shaytan and when the sun gets higher the horn leaves it. Then when the sun reaches the meridian the horn joins it and when the sun declines the horn leaves it, and when the sun has nearly set it joins it again." The Messenger of Allah ﷺ forbade prayer at these times.
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِنَّ الشَّمْسَ تَطْلُعُ وَمَعَهَا قَرْنُ الشَّيْطَانِ فَإِذَا ارْتَفَعَتْ فَارَقَهَا ثُمَّ إِذَا اسْتَوَتْ قَارَنَهَا فَإِذَا زَالَتْ فَارَقَهَا فَإِذَا دَنَتْ لِلْغُرُوبِ قَارَنَهَا فَإِذَا غَرَبَتْ فَارَقَهَا وَنَهَى رَسُولُ اللَّهِ ﷺ عَنِ الصَّلاَةِ فِي تِلْكَ السَّاعَاتِ