Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
malik:15-51Mālik > ʿAbdullāh b. Dīnār > ʿAbdullāh b. ʿUmar

Yahya related to me from Malik from Abdullah ibn Dinar from Abdullah ibn Umar that Umar ibn al-Khattab used to say, "Do not intend to do your prayer at either sunrise or sunset, for the horns of Shaytan rise with the rising of the sun and set with its setting." Umar used to beat people for that kind of prayer.  

مالك:١٥-٥١وَحَدَّثَنِي عَنْ مَالِكٍ عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ

أَنَّ عُمَرَ بْنَ الْخَطَّابِ كَانَ يَقُولُ لاَ تَحَرَّوْا بِصَلاَتِكُمْ طُلُوعَ الشَّمْسِ وَلاَ غُرُوبَهَا فَإِنَّ الشَّيْطَانَ يَطْلُعُ قَرْنَاهُ مَعَ طُلُوعِ الشَّمْسِ وَيَغْرُبَانِ مَعَ غُرُوبِهَا وَكَانَ يَضْرِبُ النَّاسَ عَلَى تِلْكَ الصَّلاَةِ  


See similar narrations below:

Collected by Suyūṭī
suyuti:2-940bʿUmar > Lā Tataḥrrawā Biṣalātikum Ṭulūʿ al-Shams And Lā Ghurūbhā
Request/Fix translation

  

السيوطي:٢-٩٤٠b

"عَنْ عُمَرَ قَالَ: لا تَتَحرَّوْا بِصَلاتِكُمْ طُلُوعَ الشَّمْسِ وَلا غُرُوبها، فَإنَّ الشَّيْطَانَ يَطْلُعُ قَرْنَاهُ مَعَ طُلُوعِ الشَّمْسِ ويَغْرُبَانِ مَعَ غُروبِهَا، وكَانَ يَضْرِبُ النَّاسَ عَلَى تِلْكَ الصَّلَاةِ".  

مالك