Hadith 64

Sahih Bukhari

Book 9: Times of the Prayers

Chapter 32

Whoever did not dislike to offer optional prayers except after the compulsory prayers of 'Asr and Fajr only

باب مَنْ لَمْ يَكْرَهِ الصَّلاَةَ إِلاَّ بَعْدَ الْعَصْرِ وَالْفَجْرِ

This has been narrated by 'Umar, Ibn 'Umar, Abu Sa'id and Abu Hurairah. ​​
رَوَاهُ عُمَرُ وَابْنُ عُمَرَ وَأَبُو سَعِيدٍ وَأَبُو هُرَيْرَةَ.
Sahih al-Bukhari 589
حَدَّثَنَا أَبُو النُّعْمَانِ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ أَيُّوبَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ أُصَلِّي كَمَا رَأَيْتُ أَصْحَابِي يُصَلُّونَ، لاَ أَنْهَى أَحَدًا يُصَلِّي بِلَيْلٍ وَلاَ نَهَارٍ مَا شَاءَ، غَيْرَ أَنْ لاَ تَحَرَّوْا طُلُوعَ الشَّمْسِ وَلاَ غُرُوبَهَا‏.‏
Ibn `Umar:

I pray as I saw my companions praying. I do not forbid praying at any time during the day or night except at sunset and sunrise.