The Prophet ﷺ asked Abu Dharr when the sun had set, "Do you know where it goes?"Abu Dharr replied, "Allah and His Messenger know best."He said, "It travels until it prostrates beneath the Throne…"
قال النبي ﷺ لأبي ذر حين غربت الشمس: أتدري أين تذهب؟ قلت: الله ورسوله أعلم. قال: فإنها تذهب حتى تسجد تحت العرش…
Bukhari related it in the Beginning of Creation (3199), and Muslim in the Book of Faith (159), both from the hadith of Ibrahim Taymi, from his father, from Abu Dharr, in a long hadith, which is mentioned in its place. In another version, Abu Dharr said, "I asked the Messenger of Allah about the words of Allah Almighty, "And the sun runs its course to a resting place for it" [Surah Yasin 36:38]. He said, 'Its resting place is beneath the Throne.'"