once you've subtracted them you have the difference in seconds and just have to do simple maths on it.
$seconds = $remainingtime % 60; // remainder when divided by 60
$minutes = floor($remainingtime / 60); // 60 seconds in a minute
$hours = floor($remainingtime / 3600); // 60 * 60 (secs in an hour)
$days = floor($remainingtime / 86400); // 60 * 60 * 24 (secs in a day)
|