I've never really understood the whole be-all-end-all debate over the "how old is the Earth" question when it comes to creationists versus non-creationists.
One solution to that apparent contradiction is that many creationists could very easily be wrong in trying to take the Genesis account of the creation as in being a literal 7 (24-hour) day period. There is nothing in the actual Hebrew text that prevents the Genesis account from being allegorical, even when taking into account the "Evening and Morning" references and the application of the seven days of creation with a seventh day of rest as a pattern for the Jewish Sabbath. After all, the seven "days" of creation came from God's perspective and not man's. Both David and Peter make references to God being outside of our concept of time. While those references are not talking directly about creation the principle is still a constant - God exists and acts outside of our time. Therefore an "age" or "era" or "day" - all the same Hebrew word - to God could conceivably refer to any amount of physical concept of time. Many "scholars" will point to the references in the Genesis account of the "Evening" and "Morning" being the first day, the second day, etc. as proof that it was a literal 24 hour period. As far as the "Evening" and "Morning" are concerned what determined, from God's perspective, when the "Evening" and "Morning" came? After all our "day" and, as a result, our "Evening" and "Morning" are determined by the speed of the Earth's rotation in relation to the Sun. According to the Genesis account the Sun wasn't created until the fourth day. How, then, was the "Evening" and "Morning" determined on days 1 to 3? If you take the creation account in Genesis to be allegorical as opposed to literal then there is no reason why God could not have created the universe in its infancy, set it in motion, watched and helped as necessary as it developed along its expansion, created (either miraculously or providentially) life on Earth, and then rested as His creation was ready to evolve on its own. This would naturally account for both the age and development of the Earth, as believed by Evolutionists, without making that age a contradiction to the Earth being God's creation.
Another solution is even simpler. First, everything in this universe is in order; it has rules, it has rhythm, it has consistency. Without that order all matter in the universe would exist in chaos and life would not be possible. Since those rules that govern the universe are both necessary for life as well as the foundation for many Evolutionists' beliefs, does it not follow logic that if God created the universe that He set those rules in place? If He set those rules in place, then does it not follow that His creation - from inception to destruction - would also follow those rules? If so, then even if God did create the universe in a literal week made up of 24 hour days He - having the power to create the universe - could have created it in the same state as if it had evolved naturally to that point. This possibility would not violate even a literal interpretation of the Genesis creation account while explaining the apparent age and evolution of the Earth and the universe.
Between these two possibilities; some combination of these two possibilities; and the additional probability that we are not as proficient in our understanding of the Earth, much less the entire universe, then the question of "how old is the Earth" - as far as Creationists are concerned - should neither be a stumbling block to nor even a contradiction of the belief that God created the Heavens and the Earth.
It's all a matter of perspective. After all, the validity and consequences of the answer depend entirely upon the question. For Evolutionists, the question is "How old is the Earth?" while, for Creationists, the question should be "How old does the Earth appear?" and, while both questions may have the same answer the ramifications of that answer vary greatly depending upon how you view the question.