The Quran asserts that the universe in its current form has been created in 6 periods (note that the Arabic word for "days" (yom) also means "periods" or "eons").
[Quran 7:54] Indeed, your Lord is Allah , who created the heavens and earth in
six days...
The Quran also asserts that the Earth in its current form has been in existence for 2 periods:
[Quran 41:9] Say, "Do you indeed disbelieve in He who created the earth in
two days...
The Quran makes it clear elsewhere that the periods discussed refer to the periods of existence:
[Quran 50:38] And indeed we created the heavens and the earth and
all between them in
six days
When the Quran says that Allah created the Universe and the Earth and Everything in between them (including humans and all other things presently on Earth) in six days this means that the Quran is referring to the period of existence. That means that in the distant future, the Quran would say that Allah created the universe and the earth and all that is between them (what will become between them) in 7, or 8, or 9 periods and so on. In other words, this is similar to Carl Sagan's 12 month cosmic calendar.
At the time of the Quranic revelation (everything in between of the universe and earth), the universe has existed for 6 periods. And the Earth (which is contained in the universe) has existed for 2 periods out of the 6. This makes the Earth to be 2/6th (1/3rd ) the age of the universe.
Modern cosmology estimates that the universe is 13.7 billion years old and that the Earth is 4.54 billion years old. 4.54/13.7 is roughly 1/3rd. So according to modern cosmology, the Earth should be roughly 1/3rd the age of the universe. This cosmological finding interestingly complements the Quran! Why did the Quran accurately say Earth was created in 2 periods? Why did it give the correct ratio? How did an unlettered prophet know such a thing?
--------------------------------------------------------------
Now, let's turn our attention into another set of verses:
[Quran 41:10] And He placed on the earth firmly set mountains over its surface, and He blessed it and
determined therein its
sustenance in
four days without distinction - for [the information] of those who ask.
Notice how the Quran used the word "and" rather than "then". This means these two statements are not successive events, but just a description of what Allah did. The verse states that Allah determined Earth's sustenance in 4 days. This may refer to the determination of the length of time set to establish Earth's provision (materials that contribute to the formation of the Earth to be in the right location at the right time as Allah determined--this took 4 days). See picture below:

[Quran 41:11] Then He directed Himself to the heaven while it was
smoke and said to it and to the earth, "Come, willingly or by compulsion." They said, "We have come willingly."
Now, the Quran uses the word "then" to indicate a successive event. That is: after Allah determined the provision of the Earth in 4 days, he made the Earth and the Heaven come together. This is also very interesting in its cosmological accuracy. The Earth formed through an accretion process whereby star dust (smoke) collapsed in itself due to the force of gravity which led to the birth of our planet.
Here is a video describing the process. Note the
smoke/dust and the primitive Earth coming together just as the Quran described with stunning accuracy:
https://www.youtube.com/watch?v=Uhy1fucSRQI&feature=emb_title