The Messenger of Allah ﷺ said, "None of you should deliberately time his prayer to coincide with sunrise or sunset."
أن رسول الله ﷺ قال: لا يتحرى أحدكم فيصلي عند طلوع الشمس، ولا عند غروبها.
Malik narrated it in the Quran (47), from Nafi, from Abdullah bin Umar, and mentioned the hadith. Bukhari narrated it in Prayer Times (585), from Abdullah bin Yusuf, and Muslim in the Prayer of Travelers (828), from Yahya bin Yahya, both of them from Malik, in like manner. In a version found in both of them, "Do not deliberately time your prayers for sunrise or sunset." Muslim added, "For it rises between the two horns of Satan."Bukhari (582) narrated from Musaddad, who said, Yahya bin Saeed narrated to me, from Hisham, from his father, who said, Ibn Umar informed me. Muslim narrated it through other channels from Hisham, in like manner. Bukhari then said, and he said, Ibn Umar narrated to me, meaning through the same chain given earlier from the hadith of Musaddad, in like manner. He, ﷺ, said, "When the edge of the sun appears, delay the prayer until it rises fully, and when the edge of the sun disappears, delay the prayer until it sets fully." Abda followed him in narrating this, and Muslim narrated something similar as well.As for the hadith of Abda, that is, Ibn Sulayman, Bukhari narrated it in the Beginning of Creation (3272), from Muhammad, meaning Ibn Salam, from him, from Hisham bin Urwa, from his father, from Ibn Umar, and he mentioned the same. In a version found in both of them, "Do not deliberately time your prayers for sunrise or sunset, for it rises between the two horns of Satan, or of the devil." Abda said, as recorded in Bukhari, "I do not know which of the two Hisham said" (3273).As for his statement, "For it rises between the two horns of the devil," this refers to someone watching the sun as it rises, for if he were to watch the devil, he would see him standing upright right beside it. This is as stated in Fath al-Bari (6/340).