Ex 20:11 -
For in six days the Lord made the heavens and the earth, the sea, and all that is in them, and rested the seventh day. Therefore the Lord blessed the Sabbath day and hallowed it.
In Genesis, the Sun does not appear until Day Four, solar days are measured relative to the Sun. Genesis is 31 sentences, it not meant to be a detailed history or a scientific exposition on how God's plan works. Maimonides, I think, once said that if our interpretation of the Bible conflicts with good science then we need to take another look at our interpretation. I think he was a pretty smart guy.