Jareer bin Abdullah reported,

Jarir reported, "We were sitting one night with the Prophet ﷺ when he looked at the moon on the fourteenth night and said, 'You will surely see your Lord just as you see this moon. You will have no difficulty in seeing Him. So if you are able not to be overcome 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" [Qaf 50:39].

Azami 13393

Sahih

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

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

الأعظمي 13393صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Qaf
Section
His saying, "So be patient over what they say and exalt with praise of your Lord before the rising of the sun and before its setting, and during periods of the night exalt"
Numbering
Jami al-Kamil 13393 (2nd edition)
Azami 13393