A "day" is forty years in Hebrews 3:8-9
Harden not your heart, as in the provocation, in the day of temptation in the wilderness: when your fathers tempted me, proved me, and saw my works forty years. (GNV)
The people of God tempted Him forty years and yet God calls this
the day of temptation.
This is one of many examples in the scriptures that prove we should not assume that his words regarding time are literal. A "day" is often used to describe a period of time, or even a spiritual condition, and not a day as we literally say is 24 hours.
In the book of Hebrews, the people tempted God repeatedly. There was the time they made a golden calf and worshiped it. There was another time that Moses hit a rock twice with his staff to provide water for the people, and yet God commanded him to
speak to the rock. There was another time that the people complained that God was not providing them the food they wanted and then fiery serpents began to bite them. They tempted God day after day, for forty years. Yet God's Word calls it "the day of temptation".
With that in mind, we should not believe that God literally made everything and all life in 6 days, as is recorded in Genesis. He made everything is 6 distinct time periods, which to us are so long that our limited intellect cannot understand. These days are epochs, ages, periods of time.... not literal 24-hours days.
A day to God is not always a literal day.