The sun changed its orbit – Miracle of the People of the Cave
This is a reality that the sun moves in its own orbit. It neither delays nor makes haste anywhere in its path. It does not swerve a hairbreadth’s worth of distance from its path. This is the system of nature. In spite of all this, Allah Most High granted the People of the Cave such excellence that for the whole time they spent in the cave, the sun swerved from its path. When it would rise on the earth, it would move to its right and while setting, it would move to the left, so that the rays of the sun didn’t fall on them. Allah Most High says in the Holy Quran:
And you see that the sun, when it rises, moves to the right from their cave and inclines obliquely from them to the left when it sets while they are (lying) in the open chamber of the cave. This (change of the sun’s course) is one of the (great) Signs of Allah’s (Might). He whom Allah guides is the one who is rightly guided, but one whom He holds strayed you will not find for him any wali (friend to help) and murshid (guide to show the path). Surah Kahf (18:17)
This is a sign of the power of Allah Most High and a miracle of the People of the Cave that for the whole time they spent in the cave, the sun changed its path for them.
Imam Raazi (May Allah shower His Mercy on him) writes in the Tafseer of this verse:
Translation: The rising and setting of the sun in this way is against what usually happens and is a great miracle, which Allah Most High has granted to the People of the Cave. (Tafseer Kabeer, Surah Kahf-17)