Note that there is a mistranslation here. As Rashi points out below, it is not “the first day” (which would be the same conjugation as in the second day, the third day, elsewhere in the passage) but “one day”. Many scholars throughout history have found meaning in this difference. The Mishnah (Chullin 83a) uses this verse to justify the definition of a “day” as being not just the day but the evening/night which precedes it.
Many make the case that the Hebrew word here for “day” could also mean a span of time, allowing for people who favor a more literal interpretation to also envelope evidence of an Old Earth within the confines of the verses. However, while it is true that “day”, both here and in English (“Back in my day”), can mean a span of time, the pairing with evening and morning implies that an actual 24 hour span is intended here.
It would make more sense to interpret the 7 day period of Creation as a metaphorical expression of a theological truth. This solves all of the questions about what marked a day before the sun and the moon existed, and also fits fairly well with other metaphorical representations of theological truths found in the text (see commentary on verse 7). Note that many Church Fathers, including Augustine and Origen, held this view.
The fact that this was day 1 lends credence to the ex nihilo interpretation of verse 1, because this verse contains the creation of time.
Targum Onkelos: And the Lord called the light the Day, and the darkness He called the Night. And there was evening, and there was morning, Day the First.
Rashi: one day: According to the sequence of the language of the chapter, it should have been written, “the first day,” as it is written regarding the other days, “second, third, fourth.” Why did Scripture write“one” ? Because the Holy One, blessed be He, was the only one in His world, for the angels were not created until the second day. [i.e., יוֹם אֶחָד is understood as ‘the day of the only One’] So is it explained in Genesis Rabbah (3:8).
Rambam: God confirmed the light in its existence in God’s will. God set the measure of the light and of the darkness
Ibn Ezra: by naming the light “day” and the darkness “night.” The diurnal sphere revolved once, day blended into evening and night blended into dawn, day one
(Note: The “diurnal sphere” is a reference to a belief in geocentrism – Ibn Ezra and Rambam both held that the Earth was the center of the universe and surrounded by different rotating spheres. Ibn Ezra said there were 9, Rambam thought there were 10. In reality there are none, the Earth revolves around the Sun. FYI)