Jewish History: Biblical History: Day and Night Before the Sun was Created:
How can there have been "days" and "nights" before the sun was created?
Before light was created on the first day, there was darkness (Gen.1:2). The terms "evening" and "morning" are used to describe the transitions between the first, second, third, and fourth days; this implies that the light periodically went out and came on again, even before the sun was created. The periods when the light was on were called "days", and those when it was out were called "nights" (Gen.1:5), even though they were not caused by the rising and setting of the sun. Since the creation of the sun on the fourth day, the light that was created on the first day has not been visible on the earth; we will see it again in the next world.
Ask a follow-up question