SHOWING THE DIFFERENCE BETWEEN 2 DATES IN DAYS, HOURS, AND MINUTES - May 15th, 2015


Here's an interesting idea that was posted by CMSB user mjftech.


<?php
$openDate = strtotime($record['createdDate']);
$closeDate = strtotime($record['closedDate']);
$dateDiff = ($closeDate - $openDate);

$d = ($dateDiff/(60*60*24))%365;
$h = ($dateDiff/(60*60))%24;
$m = ($dateDiff/60)%60;

echo
$d." days\n";
echo
$h." hours\n";
echo
$m." minutes\n";
?>



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service