Jareer bin Abdullah reported,

We were with the Prophet ﷺ when he looked at the moon on a night when it was full and said, "You will see your Lord just as you see this moon. You will have no difficulty seeing Him. So if you are able to never be overcome by anything that prevents you from praying before sunrise and before sunset, then do so."Then he recited, "And glorify the praise of your Lord before the rising of the sun and before its setting" [Ta-Ha 20:130].Ismail said, "Do it, do not let it slip away from you."

Bukhari 554

Sahih

حدثنا الحميدي قال حدثنا مروان بن معاوية قال حدثنا إسماعيل عن قيس

عن جرير بن عبد الله قال

كنا عند النبي ﷺ فنظر إلى القمر ليلة يعني البدر فقال إنكم سترون ربكم كما ترون هذا القمر لا تضامون في رؤيته فإن استطعتم أن لا تغلبوا على صلاة قبل طلوع الشمس وقبل غروبها فافعلوا ثم قرأ {وسبح بحمد ربك قبل طلوع الشمس وقبل الغروب} قال إسماعيل افعلوا لا تفوتنكم

البخاري 554صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Prayer times
Chapter
Virtue of Asr prayer
Numbering
Darussalam 554
Bukhari 554