Please show me the passage.
There isn't a passage in the Bible or Quran saying "The earth is x number of years old". Religious theologians dated the world by working out dates back from dated events in these books. For example, Noah lived x number of years, so that can give his birth date etc etc etc.
Actually, there is some great merit in this. I was watching a programme - proper archaeology one (I briefly studied this ages ago, but gave it up for something more practical lol), where they were trying to date events in Egyptian history. They couldn't get a "definate" date of which pharaoh launched an invasion of a neighbouring land, and the one they picked, it made sense, but it threw out some other established Egyptian dates.
One archaeologist was working on comparisons to Bible events to recorded other history, and had a theory - one Biblical character seemed to fit Pharaoh Shishak. This though threw out lots of history, and proved he though that the Bible was not factual on history. They then examined, what if the Bible translation was incorrect - they went back to this, found another Pharaoh of similar translation - and this not only fitted with this Biblical timeline, but kicked in every other recorded Egyptian historical event of the time. Basically, it proved the Bible was correct.
Now all this of course proves, is that whichever people wrote those Biblical passages, wrote the correct historical events - it obviously doesn't prove the religious element is correct, all the same, I find this rather interesting.