Abu Dharr reported,

I entered the mosque while the Messenger of Allah ﷺ was sitting. When the sun set, he said, "Abu Dharr, do you know where this sun goes?"I replied, "Allah and His Messenger know best."He said, "It goes and seeks permission to prostrate, and it is granted permission. It is as though it has been told, 'Return from where you came,' so it rises from its place of setting."Then he recited, according to the recitation of Abdullah, "And that is its appointed resting place."

Muslim 401

Sahih

و حدثنا أبو بكر بن أبي شيبة وأبو كريب واللفظ لأبي كريب قالا حدثنا أبو معاوية حدثنا الأعمش عن إبراهيم التيمي عن أبيه

عن أبي ذر قال

دخلت المسجد ورسول الله ﷺ جالس فلما غابت الشمس قال يا أبا ذر هل تدري أين تذهب هذه قال قلت الله ورسوله أعلم قال فإنها تذهب فتستأذن في السجود فيؤذن لها وكأنها قد قيل لها ارجعي من حيث جئت فتطلع من مغربها قال ثم قرأ في قراءة عبد الله وذلك مستقر لها

مسلم 401صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Faith
Chapter
Declaration of the time when faith will not be accepted
Numbering
Darussalam 401
Muslim 401