I'm trying to find the difference between dates in years between the date stored in a MySQL database and today's date. I just simply want to know how many years are there between the two. So far I have a date stored in a MySQL database in this format:
YYYY-MM-DD
2009-05-31
I'm trying to extract it and then figure out how many years there are between that date and today's date so I figured I had to convert it to Unix so I did this
list($year, $month, $day) = split("-", $Row["RecordingDate"]);
$date1 = mktime(0, 0, 0, $month, $day, $year);
I then wanted to figure out today's date
$date2 = mktime();
And then what do I do? First off am I doing this correct so far? Second how do I put together a formula to figure out the difference in years?