Days, Hours, Minutes, Seconds Difference as Percentage

Hi All,

How do I conver the following to a percentage of difference.
When the days, hours, minutes, seconds equal zero, this will be 100%

$expirationDate = strtotime("2015-12-20 23:10:00");
$toDay = strtotime(date('Y-m-d H:i:s'));

$difference = abs($toDa - $expirationDate);

$days = floor($difference / 86400);
$hours = floor(($difference - $days * 86400) / 3600);
$minutes = floor(($difference - $days * 86400 - $hours * 3600) / 60);
$seconds = floor($difference - $days * 86400 -...
PHP:
Days, Hours, Minutes, Seconds Difference as Percentage

from PHP http://ift.tt/1O1Yd7C
via IFTTT
Previous
Next Post »
Thanks for your comment