Genesis 1:1-5
Seems to me that god created heaven and earth but earth was still without form and there was no light. Then god created light
The cosmos light existed long before it's penetration to the earth's surface. When that happened, it marked the beginning of the first day. The frame of reference for the 'days' is the earth's surface.
Atheist Credo: A universe by chance that also just happened to admit the observer by chance.