Evidently the Earth was present before there was light. "And the Earth was without form and void; and darkness was upon the face of the deep." When did God create the Earth? And related to this, what was the light of the first day? How was a 24-hour day determined before the fourth day?
Many people take Genesis 1:1, "In the beginning God created the heaven and the earth," as an introduction to the story of creation. As a result, it looks to them like God started with some sort of formless Earth at the very beginning of creation, which is not the case at all.