The Messenger of Allah ﷺ forbade praying at sunrise or sunset.
أخبرنا إسمعيل بن مسعود أنبأنا خالد حدثنا عبيد الله عن نافع
أن رسول الله ﷺ نهى أن يصلى مع طلوع الشمس أو غروبها
[Its isnad is sahih]. Ahmad transmitted it: 29/2, from the hadith of Ubaydullah bin Umar, with this chain, and it is in Kubra, hadith: 1546. The hadith is agreed upon from Nafi, see the previous hadith.