When one looks at Genesis you have to realise the audience it is intended for. If you took the most learned man from 5000 years ago and gave him all the time in the world he would not understand one bit of what we are arguing about.
Verse 16 tells us God made the Sun, Moon and stars on the fourth "day." Most young-earth creationists focus on the English translation and interpret this verse to mean God created the Sun and Moon that instant. The Hebrew does not support that interpretation. The Hebrew word for "made" (asah) refers to an action completed in the past.7 Thus, the verse is correctly rendered "God had made" rather than "God made." This indicates God "had made" the Sun, Moon and stars earlier than the fourth "day."8
This view of the fourth "day" has broad support. For example, Gleason Archer, one of the foremost evangelical Hebrew scholars, states: "[Verse 16] should not be understood as indicating the creation of the heavenly bodies for the first time on the fourth creative day …9 Likewise, Protestant theologian Wayne Grudem states: "[Verse 16] Can be taken as perfects indicating what God had done before … This view would imply that God had made the sun, moon, and stars earlier …"10
So, when were the Sun, Moon and stars created? Genesis 1:1 tells us, "In the beginning God created the heavens and the earth." The Hebrew phrase "the heavens and the earth" (hashamayim we ha' erets) refers to the entire universe, entire creation and everything that can be seen or has physical existence.11 This indicates the heavenly bodies—the Earth, Sun, Moon, stars and other planets—were created "in the beginning" prior to the six creation "days."