How Old Is the Earth According to Islam?
Question

There are some Islamic manuscripts which say that Allah created the heavens and the earth from nothing in six days, then He created Adam, the father of mankind, on the seventh day, then He created Muhammad (blessings and peace of Allah be upon him) ten generations after that.
Assuming that the length of one generation is thirty years, if we multiply it by ninety, and add to it the period of time from the birth of the Prophet (blessings and peace of Allah be upon him) until today, the result we get is that Allah created the heavens and the earth only 4137 years ago or thereabouts. But in fact this is not in accordance with what the scientists and specialists say, because they say that the earth is more than three billion years old. What is the correct view concerning this matter?
Praise be to Allah.The fact that a view or opinion is mentioned in a manuscript or printed book does not mean that that view is correct and acceptable, let alone representative of the Islamic point of view in absolute terms, just because this manuscript or book is classified as Islamic. Rather it is essential that the author who presents this view should be one of the scholars who are known for their knowledge, from whom people learn and whose views people follow. Then after that the scholar’s view should be examined on the basis of the evidence upon which he based his view, especially with regard to matters concerning which the scholars differed.
Creation of all things from nothing
What is mentioned in the manuscript referred to, “that Allah created the heavens and the earth from nothing in six days”, is mentioned in a text in the Book of Allah, may He be Exalted, so there is no need to quote from that manuscript or any other text.
Concerning the creation of all things from nothing, Allah, may He be Exalted, says (interpretation of the meaning):
{The Originator of the heavens and the earth. When He decrees a matter, He only says to it: ‘Be!’ – and it is.} [Al-Baqarah 2:117]
Al-Qurtubi (may Allah have mercy on him) said:
“The Originator of the heavens and the earth” that is, their Originator, the One Who brought them into existence, their “Innovator”, Who “invented” them without following any precedent. Anyone who originates something for which there is no precedent may be described as an innovator (mubdi‘). From the same root comes the phrase “the people of innovation (bid`ah).” Innovation is so called because the one who promoted it introduced it without following the actions or view of any scholar.” (End quote from Tafsir Al-Qurtubi, 2/86)
With regard to this creation being completed in six days, Allah, may He be Exalted, says (interpretation of the meaning):
{And indeed We created the heavens and the earth and all between them in six Days and nothing of fatigue touched Us.}  [Qaf 50:38]
The Holy Quran mentions details of creation in these six days. Allah, may He be Exalted, says (interpretation of the meaning):
{Say (O Muhammad (blessings and peace of Allah be upon him)): 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 Alamin (mankind, jinns 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 Istawa (rose over) 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.} [Fussilat 41:9-12]
Shaykh Ash-Shinqiti (may Allah have mercy on him) said:
“What appears to be the case is that what is meant by His words here – “in four Days” – is by the end of four days.
The completion of four days could be by adding two days only (to the two days of the creation of the earth), because Allah, may He be Exalted, says (interpretation of the meaning): {Say (O Muhammad (blessings and peace of Allah be upon him)): Do you verily disbelieve in Him Who created the earth in two Days.} [Fussilat 41:9], then He says: “and measured therein its sustenance (for its dwellers) in four Days” [Fussilat 41:10] that is, by the end of four days.
Then He says(interpretation of the meaning): {Then He completed and finished from their creation (as) seven heavens in two Days.} [Fussilat 41:12]. So add two days to the previous four days, and the total number of days in which He created the heavens and the earth and all that is between them is six days.
The explanation of this verse is what we have mentioned, and no other way of understanding it could be sound, because Allah, may He be Exalted, clearly stated in several verses of His Book that He created the heavens and the earth and all that is between them in six days… .” (End quote from Adwa’ Al-Bayan, 7/12)
See also the answer to question no. 31865. In the answer to question no. 20613 we discussed the wisdom in the creation being six days, despite the fact that Allah, may He be Glorified, is able to do it in a shorter time, and even in a single moment.
Creation of Adam
The scholars differed concerning the creation of Adam; there are two views.

The first view is that Friday was one of the six days; on that basis the beginning of creation was on Sunday, and its completion was on Friday, on which Adam was created. This is the view favoured by Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) in more than one place in his books.
The second view is that Friday is additional to the six days, so creation began on Saturday and ended on Thursday, and creation was completed in six days, then after a while – and Allah knows best how long it was – Allah created Adam (peace be upon him) and that was on Friday.

This second view is supported by two things:

Before Allah, may He be Exalted, created Adam, He stated that He created the earth, as He says (interpretation of the meaning):

{And (remember) when your Lord said to the angels: ‘Verily, I am going to place (mankind) generations after generations on earth.’ They said: ‘Will You place therein those who will make mischief therein and shed blood, – while we glorify You with praises and thanks (Exalted be You above all that they associate with You as partners) and sanctify You.’ He (Allah) said: ‘I know that which you do not know’} [Al-Baqarah 2:30]
This means that the creation of Adam (peace be upon him) was not included in the six days in which Allah created the heavens and the earth and all that is between them.

Adam (peace be upon him) was not included in the creation of the heavens and the earth; rather he was created from the earth, so naturally his creation came after the creation of the earth from which he was created.

There is a Hadith which is quoted as evidence by the proponents of this view.
Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) took my hand and said: “Allah, may He be Glorified and Exalted, created the earth on Saturday, and He created the mountains on Sunday. He created the trees on Monday, He created disliked (bad) things on Tuesday, He created light on Wednesday, He scattered the animals in it on Thursday, and He created Adam (peace be upon him) after ‘Asr on Friday, the last of creation in the last hour of Friday, between ‘Asr and nightfall.” (Narrated by Muslim, 2789. This Hadith was classed as flawed by some of the scholars, who viewed it as being the words of Ka‘b Al-Ahbar)
Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
“Scholars who were more knowledgeable than Muslim criticised this Hadith, such as Yahya ibn Ma`in, Al-Bukhari, and others. Al-Bukhari stated that these were the words of Ka‘b Al-Ahbar. Others regarded it as authentic, such as Abu Bakr ibn Al-Anbari, Abu’l-Faraj ibn Al-Jawzi, and others. Al-Bayhaqi and others agreed with those who regarded it as inauthentic, and this is the correct view, because it was proven through Tawatur reports that Allah created the heavens and the earth and all that is between them in six days, and it is proven that the last of creation occurred on the Friday, which means that the beginning of creation was on the Sunday. This is the view of the People of the Book, and is also indicated by the names of the days of the week (in Arabic, as the word for Sunday may be literally translated as the first day, and so on). This is what is narrated and proven in the Hadiths and other reports.” (End quote from Majmu` Al-Fatawa, 18/18)
What was affirmed by Shaykh Al-Islam here and elsewhere in his books in more than one place, was also favoured by his student Imam Ibn Al-Qayyim (may Allah have mercy on him), as it says in Al-Manar Al-Munif (85) and by Al-Hafidh Ibn Kathir (may Allah have mercy on him) in his Tafsir (1/215).
That was disputed by Shaykh Al-Mu`allimi Al-Yamani, Shaykh Al-Albani, and others.
Al-`Allamah Al-Mu`allimi (may Allah have mercy on him) said:
“There is nothing in this Hadith to indicate that Allah created anything on the seventh day except Adam, and there is nothing in the Quran to indicate that He created Adam in the first six days; rather this is known to be incorrect.
In the verses at the beginning of Al-Baqarah which speak of the creation of Adam, and in some reports, there is that which may be understood to mean that there were creatures that lived on the earth before Adam, and that lived for a long time. This may support the view that the creation of Adam came much later than the creation of the heavens and the earth.
Think about the verses and the Hadith in the light of this explanation, and it will become clear to you, if Allah wills, that the claim that this Hadith contradicts the apparent meaning of the Quran will be resolved, praise be to Allah.” (End quote from Al-Anwar Al-Kashifah, p. 187-188)
Shaykh Al-Albani (may Allah have mercy on him) said:
“It is not contrary to the Quran in any way whatsoever, in contrast to what some people may think. The Hadith explains how things were created on the face of the earth, and that that happened in seven days. The statement of the Quran, that the creation of the heavens and the earth occurred in six days, is not contrary to that, because it is possible that these six days were something other than the seven days mentioned in the Hadith. It – I mean the Hadith – is speaking of one stage in the development of creation on the face of the earth, until it became fit for habitation. This is supported by the fact that the Quran states that some days with Allah, may He be Exalted, are as a thousand years, and some are as fifty thousand. So why shouldn’t these six days be like that? And the seven days could be like the days that we know, as the Hadith clearly states. In that case there is no contradiction between this Hadith and the Quran.”  (End quote from Mishkat Al-Masabih, 3/1597)
In how many days did Allah create the heavens and the earth?
According to either view, there is no contradiction between the number of days in which Allah created the heavens and the earth, which is six days, and the creation of Adam on Friday. According to the first view, Friday is included in the six days. This is clear and there is no problem in understanding it. But according to the second view, the creation of Adam is not included in the heavens or the earth, as is also the case with regard to the creation of the angels, Iblis and the devils. Rather the apparent meaning of the Quran is that the creation of the heavens and the earth and all that is between them occurred before the creation of all of these creatures.
At-Tahir Ibn `Ashur (may Allah have mercy on him) said:
“It should be understood that Allah, may He be Glorified and Exalted, created the heavens and the earth before He created their inhabitants, as is indicated by His words (interpretation of the meaning):
{Say (O Muhammad (blessings and peace of Allah be upon him)): Do you verily disbelieve in Him Who created the earth…} [Fussilat 41:9]” (End quote from At-Tahrir wat-Tanwir, 15/343)
Did Allah create Muhammad ten generations after creating the heavens and earth?
The words of the questioner, “then He created Muhammad (blessings and peace of Allah be upon him) ten generations after that” are not correct, especially according to his view that “the length of one generation is thirty years.” The length of time between Adam (peace be upon him) and the birth of the Prophet (blessings and peace of Allah be upon him) is not known exactly. We have discussed this matter in detail in the answer to question no. 20907.
Is the length of one generation thirty years?
What is mentioned in the question about the “the length of one generation is thirty years” is not correct. Nuh (peace be upon him) remained among his people, calling them to Allah, for one thousand years less fifty, so how long was that generation?!
The calculations that are based on that are also not correct, which is where you say, “the result we get is that Allah created the heavens and the earth only 4137 years ago or thereabouts.” But there is another issue, that may be another cause of confusion, which is confusing the age of the earth with the age of mankind, which is a clear mistake. The earth was created before mankind, and the calculation of the period between Adam (peace be upon him) and our own time, even if we assume that it is possible to work it out precisely, or even approximately, does not mean that this is the age of the earth. Attention must be paid to this, and the two matters should not be confused.
If it is difficult for researchers to figure out the exact age of man and the time between Adam and Muhammad (peace be upon them both), then working out the age of the earth is even more difficult. Therefore contemporary scientists differed greatly concerning its age, which indicates that the matter is not based on what is most likely and does not even come close, let alone being based on certainty. Some of them said that the earth is 3 billion years old and others said that it is 4.5 billion years old. A third group said that it is older than 13 billion years. All of these are mere conjecture; there is no definitive proof as to that any of these views is correct.
And Allah knows best.