I use Xampp to write/test codes before uploading to hosted server. Unfortunately my hosted server uses an older version of PHP (5.2.17) than Xampp (PHP Version 5.4.7).
I need to accomplish the below using the PHP version of my hosted server since “diff” isn’t available.
[code=php]
$todaydate = new DateTime();
$todaydate->setDate($year, $month, $day);
$todaydate->setTime(11, 15);
// Calculate number of days, months and years between today’s date and rental date
$rentdate = new DateTime($rentaldate);
$rinterval = $rentdate->diff($todaydate);
$ryears = $rinterval->format(‘%y’);
$rmonths = $rinterval->format(‘%m’);
$rdays = $rinterval->format(‘%d’);