The Prophet ﷺ forbade praying after the afternoon prayer until the sun sets, and after the dawn prayer until the sun rises.
أن النبي ﷺ نهى عن الصلاة بعد العصر حتى تغرب الشمس، وبعد الفجر حتى تطلع الشمس.
Bazzar narrated it in Kashf Astar (613) from Muhammad bin Muthanna Abu Musa, Rawh bin Ubada narrated to us, from Usama bin Zayd, from Hafs, from Anas, and he related it.Its isnad is hasan because of Usama bin Zayd, who is Laythi, their freedman, Abu Zayd Madani, who is disputed but whose hadith is hasan.And because of Hafs, who is Ibn Ubaydullah bin Anas bin Malik. Abu Hatim said, "His hearing is not established except from his grandfather," meaning Anas bin Malik. I say, he is among the narrators of the two Sahihs, and Hafiz placed him at the rank of "truthful."Haythami mentioned the hadith in Kashf Astar, but did not mention it in Majma al-Zawaid.Bazzar said, "We do not know of anyone who narrated it from Hafs except Usama." I say, this does not harm it, for Usama is truthful and did not bring a rejected hadith.