This is what is believed in Islam, It is known in Islam that each day for God is 1000 years on earth… Hence the earth was created in 7000 earth years.
In Islam it is known that God has many creations but the ones we know are Angels (made out of light), Jins (made from Fire) and Humans (made out of carbon(clay)).
We don’t know when God created earth exactly and its not important.
But we know earth was not only created for Humans as from evidence of science we can see that Dinosaurs used to live here millions of years ago.
Coming back to God creation I believe dinosaurs are Jins and lived among us until their time came as it will be our time sometime in the future to co-exist.
Lucifer was a Jin and he was raised by God for his dedication and worship until he disobeyed God when God said kneel to my creation (Adam) and he refused so he was banished. The point of this line is that Jins still exist and live among us but don’t mix with us.
Some religious scholars say that most inhabitants of the sea are Jins, the live in forests, wilderness etc etc we do not have to see them. Like us some worship God and some don’t. In Islam it is advised not to mess with Jins as they are more powerful than us and can hurt us if we push. Although they fear us, some Jins don’t and only hurt humans if we call for it to happen.
God left fossils as well as ruins of past civilisations for us (humans of today) to study and learn from. Examples can be Dino bones for structure and age, Baghdad battery, laws and ethics from Babylonians/Greeks/Romans, Stories of prophets etc etc…
A lot of modern Science has proved some religious tests and using science and religion we have learnt much about earth past, present and future.
Both are needed to progress and learn from…
Hope I didn’t bore you