Sahih al-Bukhari 589
Sahih al-Bukhari · Book 9: Times of the Prayers · Whoever did not dislike to offer optional prayers except after the compulsory prayers of 'Asr and Fajr only
Narrated 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.