The Bible tells us that the earth was created only a few thousand years ago. The creation took six days.
And God said, “Let there be light,” and there was light. And God saw that the light was good. And God separated the light from the darkness. God called the light Day, and the darkness he called Night. And there was evening and there was morning, the first day.
Each day consisted of an evening and a morning and had a period of light and one of darkness. Those who believe the earth is old correctly point out the the word “day” can mean a long period of time but the description of the creation days makes it clear they were literal days.