Sunan an-Nasa'i, Book 6, Hadith 70 (Nasa'i 565)

It was narrated from Ibn 'Umar that the Messenger of Allah (ﷺ) said:

"No one of you should deliberately try to pray when the sun is rising, or when it is setting."