It doesn't matter, however, an older earth coincides with scientific evidence and is more logical. I personally believe the earth is old, but creation is newer. In other words, the earth that was, existed in a previous earth age (millions of yrs ago), while the earth that we know and experience today, was created 6000 yrs ago.
Many Christians believe there is a long gap in time between Genesis 1:1 "In the beginning God created the heaven and the earth", and Genesis 1:2 "And the earth was without form and void". 'Was' is the wrong English word here. The Hebrew word used for 'was' is 'hayah' (Strong's Concordance ref #1961). 'Hayah' means; to become or came to pass. So that second verse could be better translated "the earth became void".