The majority of the English translations of the Quran verse 36.38 say the sun goes to a resting place. The following hadith makes it clear what this means. It means Muhammad thought the sun orbits a flat earth, and is reset to its starting point every dawn.
The hadith also says the one day the sun will be sent back on its course and then it will rise in the west. This would only happen if it were orbiting the earth, not as some lying Imams claim, if it were orbiting the galaxy.
36:38
Pickthall- And the sun runneth on unto a resting-place for him. That is the measuring of the Mighty, the Wise.
Yusuf Ali- And the sun runs his course for a period determined for him: that is the decree of (Him), the Exalted in Might, the All-Knowing.
Hilali-Khan- And the sun runs on its fixed course for a term (appointed). That is the Decree of the All-Mighty, the All-Knowing.
Shakir- And the sun runs on to a term appointed for it; that is the ordinance of the Mighty, the Knowing.
Sher Ali- And the sun is moving on to its determined goal. That is the decree of the Almighty, the All-Knowing God.
Khalifa- The sun sets into a specific location, according to the design of the Almighty, the Omniscient.
Arberry- And the sun -- it runs to a fixed resting-place; that is the ordaining of the All-mighty, the All-knowing.
Palmer- and the sun runs on to a place of rest for it; that is the ordinance of the mighty, the wise.
Rodwell- And the Sun hasteneth to her place of rest. This, the ordinance of the Mighty, the Knowing!
Sale- And the sun hasteneth to his place of rest. This [is] the disposition of the mighty, the wise [God].
Darwood- THe sun hastens on to its resting place its course is laid for it by the mighty one, the All-knowing.
Marriful- And the sun is quickly proceeding towards its resting place.
Hadith Bukhari Volume 4, Book 54, Number 421:
Narrated Abu Dhar:
The Prophet asked me at sunset, "Do you know where the sun goes (at the time of sunset)?" I replied, "Allah and His Apostle know better." He said, "It goes (i.e. travels) till it prostrates Itself underneath the Throne and takes the permission to rise again, and it is permitted and then (a time will come when) it will be about to prostrate itself but its prostration will not be accepted, and it will ask permission to go on its course but it will not be permitted, but it will be ordered to return whence it has come and so it will rise in the west. And that is the interpretation of the Statement of Allah: "And the sun Runs its fixed course For a term (decreed). that is The Decree of (Allah) The Exalted in Might, The All-Knowing." (36.38)