I've been trying to research how to do this and I've come to my last option SO.
I only saw getting the difference of dates in days but I need to get the number of months.
if I do this
$date1 = new DateTime(date('Y-m-d'));
$date2 = new DateTime(date('2013-04-10'));
$interval = $date2->diff($date1);
$interval->format("%m months");
I get 7 months
which is wrong because it is last year so the value must be 19 months
.