Jareer bin Abdullah reported,

We were sitting one night with the Prophet ﷺ when he looked up at the moon on the fourteenth night and said, "You will surely see your Lord just as you see this moon, having no trouble seeing Him. So if you are able to never be overcome from performing a prayer before the rising of the sun and before its setting, then do so."Then he recited, "And glorify the praise of your Lord before the rising of the sun and before its setting" [Qaf 50:39].

Bukhari 4851

Sahih

حدثنا إسحاق بن إبراهيم عن جرير عن إسماعيل عن قيس بن أبي حازم

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

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

البخاري 4851صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
And glorify the praises of your Lord before the rising of the sun and before its setting
Numbering
Darussalam 4851
Bukhari 4851