It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Do not pray at the time the sun rises, nor at the time it sets, for it rises and sets upon the horn of Satan; but in the interval between those times, pray as much as you wish."
The chain of this hadith is hasan (good). Imam Ahmad narrated it in his Musnad.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الصلاة / 304
Hadith Gradingمحدثین:إسناده ضعيف
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :إسناده ضعيف. » «أخرجه الضياء المقدسي فى "الأحاديث المختارة"، 1883، وأبو يعلى فى «مسنده» برقم: 4216، وأورده ابن حجر فى "المطالب العالية"، 304، وأخرجه البزار فى «مسنده» برقم: 6460»