It was narrated from Ibn 'Umar that the Messenger of Allah (ﷺ) forbade praying when the sun is rising or setting. Sunan an-Nasa'i Book 6, Hadith 71