I managed to make it count difference of two dates, but because it actually counts time difference once you get past target date it starts counting up (and I need remaining days then show overdue days with negative indicator "-" plus a note ). I have sorted the note but it only works if remaining months and days equals 0.
Code:
<?php
$v = $row_rsHardwareAsset['maintenanceint'];
$date = $row_rsHardwareAsset['lastmaint'];
$date = strtotime(date("Y-m-d", strtotime($date)) . " +$v month");
$date = date("Y-m-d", $date); // next maintenance day
$date1 = date("Y-m-d");
$date2 = $date;
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
if ($months == 0 && $days == 0) {
echo "<h1>MAINTENANCE OVERDUE!</h1>";
} else printf("%d months, %d days\n", $months, $days);
?>