Hadithcore
Sahih al-Bukhari, 589
sahih

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.

حَدَّثَنَا أَبُو النُّعْمَانِ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ أَيُّوبَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ أُصَلِّي كَمَا رَأَيْتُ أَصْحَابِي يُصَلُّونَ، لاَ أَنْهَى أَحَدًا يُصَلِّي بِلَيْلٍ وَلاَ نَهَارٍ مَا شَاءَ، غَيْرَ أَنْ لاَ تَحَرَّوْا طُلُوعَ الشَّمْسِ وَلاَ غُرُوبَهَا‏.‏

References2 variants
In-Book Reference
Book 9, Hadith 64
USC-MSA web (English) reference
Vol. 1, Book 10, Hadith 563 (deprecated numbering scheme)