I have been asked in comments to talk about why I believe that the days of creation are literal 24-hour days. I explained that the word yom in Hebrew, when used in this context means a literal day. Then a very interesting question was posed to me. If it is a true literal day, what about days 1-3 when there were no sun or moon? I want to examine that issue so we can have a better picture of the purpose of the sun and moon.
 And God said, “Let there be light,” and there was light.  And God saw that the light was good. And God separated the light from the darkness.  God called the light Day, and the darkness he called Night. And there was evening and there was morning, the first day.” (Genesis 1:3-5 ESV)
The first thing we see is the creation of light. Verse five shows us that the light is day, darkness is night. We then see that there was evening and morning the first day. From the very beginning we see that night and day, evening and morning, have no direct relation to the sun and moon. Now, I know that will be a hard pill for some to swallow, but we need to go by what the text actually states. Now let’s look further.
 And God said, “Let there be lights in the expanse of the heavens to separate the day from the night. And let them be for signs and for seasons, and for days and years,  and let them be lights in the expanse of the heavens to give light upon the earth.” And it was so.  And God made the two great lights—the greater light to rule the day and the lesser light to rule the night—and the stars.  And God set them in the expanse of the heavens to give light on the earth,  to rule over the day and over the night, and to separate the light from the darkness. And God saw that it was good.  And there was evening and there was morning, the fourth day. (Genesis 1:14-19 ESV)
Now God creates sun, moon, and stars on the fourth day. One thing we need to remember is that Day and Night were already established, evening and morning. The lights were given as separators between day and night, a distinguishing characteristic. These lights would give light to the earth and rule their respective time periods. Yet, the day still ends with evening and morning.
A plain reading of the language and intent is clear that this is not different between days 1-3 and days 4-6 in the creation narrative. Days 4-6 are simply more complex in their beauty and features. We must always take care to not read into the text a meaning that is not there and a careful reading of this passage is clear that the time period is evening and morning, one day.
We also must always consult Scripture when interpreting Scripture:
 “Remember the Sabbath day, to keep it holy.  Six days you shall labor, and do all your work,  but the seventh day is a Sabbath to the LORD your God. On it you shall not do any work, you, or your son, or your daughter, your male servant, or your female servant, or your livestock, or the sojourner who is within your gates.  For in six days the LORD made heaven and earth, the sea, and all that is in them, and rested on the seventh day. Therefore the LORD blessed the Sabbath day and made it holy. (Exodus 20:8-11 ESV)
God commands that we rest one day in seven to give to Him. He explains that it is because he created in six days and rested on the seventh and we should follow that example. We clearly understand this to mean a literal seven day week consisting of seven 24-hour periods. That helps us clearly and rightly interpret Genesis chapter one.