HOW OLD DOES THE BIBLE TEACH THAT THE EARTH IS?

Around the turn of the Twentieth Century there was a popular push to respond to scientific naturalism (Darwinian Evolution) built on the 19th century rise of theological liberalism (which regards the Biblical accounts of miracles as myths). This led to a series of books being produced known as The Fundamentals. Thus, fundamentalism was birthed. Embedded into this fundamentalism was the idea of Young Earth Creationism (YEC). The ‘Fundamentals’ became prominent during the famous Scopes Trial, and soon became the adopted standard for orthodoxy within mainstream Evangelicalism. It proposed that the 6 days of creation, were literal 24-hour consecutive days which began, based on calculations drawn from the Biblical genealogies, around 4000 BC – meaning that the earth was 6,000 years old. Yet as the scientific cosmological evidence mounted for a universe and our planet being billions of years old – not thousands – two things seemed to have happened:

(i) Young people who were scientifically literate dismissed the Bible because of the incompatibility of  YEC with current cosmological evidence;

(ii) Young Earth Creationists developed a theory of conspiracy about mainstream scientists by claiming that the scientific community were misinterpreting the data and too spiritually blind to see that YEC was correct.
But how credible is Young Earth Creationism and how reliably can the Bible be used to calculate the age of the universe and Earth?