3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Get current time $date1 = mktime(0,0,0,07,01,2014); // Get the timestamp of 2006 October 20 $date2 = mktime(0,0,0,07,05,2014); $dateDiff = $date1 - $date2; $fullDays = floor($dateDiff/(60*60*24)); $fullHours = floor(($dateDiff-($fullDays*60*60*24))/(60*60)); $fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60); echo "Differernce is $fullDays days, $fullHours hours and $fullMinutes minutes.";
Output for 4.3.0 - 7.1.0
Differernce is -4 days, 0 hours and 0 minutes.