This is an issue which confuses some people, and some of them think that Allaah created the heavens and the earth in eight days as Allaah says in Soorah Fussilat (interpretation of the meaning):
“Say (O Muhammad): Do you verily disbelieve in Him Who created the earth in two Days? And you set up rivals (in worship) with Him? That is the Lord of the ‘Aalameen (mankind, jinn and all that exists).
He placed therein (i.e. the earth) firm mountains from above it, and He blessed it, and measured therein its sustenance (for its dwellers) in four Days equal (i.e. all these four ‘days’ were equal in the length of time) for all those who ask (about its creation).
Then He rose over (Istawa) towards the heaven when it was smoke, and said to it and to the earth: ‘Come both of you willingly or unwillingly.’ They both said: ‘We come willingly.’
Then He completed and finished from their creation (as) seven heavens in two Days and He made in each heaven its affair. And We adorned the nearest (lowest) heaven with lamps (stars) to be an adornment as well as to guard (from the devils by using them as missiles against the devils). Such is the Decree of Him, the All-Mighty, the All-Knower”
because this seems to contradict the other verse which says that He created them in six days.
This is a misunderstanding, and the answer to it is as follows:
There is no contradiction between the time period mentioned in these verses and the other verse which says that it was six days.
In these verses – from Soorah Fussilat – we see that Allaah is telling us that He “created the earth in two Days”.
Then He “placed therein (i.e. the earth) firm mountains from above it, and He blessed it, and measured therein its sustenance (for its dwellers)” in four days equal– i.e., in two days that were added to the two days in which He created the earth, so the total is four days. It does not say that the creation of the mountains and the measuring of the sustenance took four days.
Perhaps the confusion which is mentioned in the question stems from this, i.e., from thinking that the four days are added to the two days in which the earth was created, equaling six, and then adding the two days in which the heavens were created (“Then He completed and finished from their creation (as) seven heavens in two Days”) – making a total of eight days, not six days. But this confusion can be dispelled by dealing with this mistaken notion. So the earth was created in two days, and the mountains were created and the sustenance measured in two more days which makes a total of four, i.e., this took the other two days. Then the creation of the seven heavens took two days. So the total is six days of the Days of Allaah, may He be glorified and exalted.
The mufassireen commented on this fact which deals with the mistaken notion. Al-Qurtubi said:
“in four days” – this is like someone saying, “I set out from Basra to Baghdad in ten days and to Kufa in fifteen days, i.e., a total time of fifteen days.” (al-Jaami’ li Ahkaam al-Qur’aan, vol. 15, p. 343).
Al-Baghawi said: “in four days” means the creation of what is in the earth. The measuring of the sustenance was on Tuesday and Wednesday, which along with Sunday and Monday add up to four days. This is like saying “I married a woman yesterday and today I married two” – one of whom is the woman whom he married the day before.
Tafseer al-Baghawi, 7/165
Al-Zajjaaj said: “in four days” means two days added to the previous two days.
Al-Kashshaaf, vol. 3, p. 444
These verses – from Soorah Fussilat – confirm the other verse, which says that the creation of the heavens and the earth was completed in six days. So there is no contradiction concerning the period in which Allaah created the heavens and the earth. There cannot be any such contradictions in the Qur’aan..
And Allaah knows best.