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.
bukhari:589Abū al-Nuʿmān > Ḥammād b. Zayd > Ayyūb > Nāfiʿ > 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.  

البخاري:٥٨٩حَدَّثَنَا أَبُو النُّعْمَانِ حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ عَنْ أَيُّوبَ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ قَالَ

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


See similar narrations below:

Collected by Bukhārī
bukhari:1191Yaʿqūb b. Ibrāhīm > al-Dawraqī > Ibn ʿUlayyah > Ayyūb > Nāfiʿ > Ibn

Ibn ʿUmar never offered the Duha prayer except on two occasions: (1) Whenever he reached Mecca; and he always used to reach Mecca in the forenoon. He would perform Tawaf round the Kaʿba and then offer two rakʿat at the rear of Maqam Ibrahim. (2) Whenever he visited Quba, for he used to visit it every Saturday. When he entered the Mosque, he disliked to leave it without offering a prayer. Ibn ʿUmar narrated that Messenger of Allah ﷺ used to visit the Mosque of Quba (sometime) walking and (sometime) riding. And he (i.e. Ibn ʿUmar) used to say, "I do only what my companions used to do and I don't forbid anybody to pray at any time during the day or night except that one should not intend to pray at sunrise or sunset."  

البخاري:١١٩١حَدَّثَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ هُوَ الدَّوْرَقِيُّ حَدَّثَنَا ابْنُ عُلَيَّةَ أَخْبَرَنَا أَيُّوبُ عَنْ نَافِعٍ أَنَّ ابْنَ عُمَرَ ؓ كَانَ لاَ يُصَلِّي مِنَ الضُّحَى إِلاَّ فِي يَوْمَيْنِ يَوْمَ يَقْدَمُ بِمَكَّةَ فَإِنَّهُ كَانَ يَقْدَمُهَا ضُحًى فَيَطُوفُ بِالْبَيْتِ ثُمَّ يُصَلِّي رَكْعَتَيْنِ خَلْفَ الْمَقَامِ وَيَوْمَ يَأْتِي مَسْجِدَ قُبَاءٍ فَإِنَّهُ كَانَ يَأْتِيهِ كُلَّ سَبْتٍ فَإِذَا دَخَلَ الْمَسْجِدَ كَرِهَ أَنْ يَخْرُجَ مِنْهُ حَتَّى يُصَلِّيَ فِيهِ قَالَ وَكَانَ يُحَدِّثُ

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