At any point during the countdown you have a start time (i.e. now) and an end time.
A standard method is to work out the difference between the two times in seconds, and then work out how many multiples of 'whole' periods are in that difference (i.e. years, months, days etc.) where a minute is 60 seconds, an hour is 3600 and so on.
Do a search for 'PHP countdown scripts' on Google and you will find some useful code snippets ;).