كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(37)
Chapter: The virtue of the Subh and the `Asr prayers, and of maintaining them
(37)
باب فَضْلِ صَلاَتَىِ الصُّبْحِ وَالْعَصْرِ وَالْمُحَافَظَةِ عَلَيْهِمَا ‏
Sahih Muslim 633 a

Jarir b. Abdullah is reported to have said:

We were sitting with the Messenger of Allah (ﷺ) that he looked at the full moon and observed: You shall see your Lord as you are seeing this moon, and you will not be harmed by seeing Him. So if you can, do not let -yourselves be overpowered in case of prayer observed before the rising of the sun and its setting, i. e. the 'Asr prayer and the morning prayer. Jarir then recited it:" Celebrate the praise of thy Lord before the rising of the sun and before Its setting" (xx. 130).
وَحَدَّثَنَا زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا مَرْوَانُ بْنُ مُعَاوِيَةَ الْفَزَارِيُّ، أَخْبَرَنَا إِسْمَاعِيلُ بْنُ أَبِي خَالِدٍ، حَدَّثَنَا قَيْسُ بْنُ أَبِي حَازِمٍ، قَالَ سَمِعْتُ جَرِيرَ بْنَ عَبْدِ اللَّهِ، وَهُوَ يَقُولُ كُنَّا جُلُوسًا عِنْدَ رَسُولِ اللَّهِ صلى الله عليه وسلم إِذْ نَظَرَ إِلَى الْقَمَرِ لَيْلَةَ الْبَدْرِ فَقَالَ ‏"‏ أَمَا إِنَّكُمْ سَتَرَوْنَ رَبَّكُمْ كَمَا تَرَوْنَ هَذَا الْقَمَرَ لاَ تُضَامُّونَ فِي رُؤْيَتِهِ فَإِنِ اسْتَطَعْتُمْ أَنْ لاَ تُغْلَبُوا عَلَى صَلاَةٍ قَبْلَ طُلُوعِ الشَّمْسِ وَقَبْلَ غُرُوبِهَا ‏"‏ ‏.‏ يَعْنِي الْعَصْرَ وَالْفَجْرَ ثُمَّ قَرَأَ جَرِيرٌ ‏{‏ وَسَبِّحْ بِحَمْدِ رَبِّكَ قَبْلَ طُلُوعِ الشَّمْسِ وَقَبْلَ غُرُوبِهَا‏}‏ ‏.‏
Reference : Sahih Muslim 633a
In-book reference : Book 5, Hadith 267
USC-MSA web (English) reference : Book 4, Hadith 1322
  (deprecated numbering scheme)