3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fromDate="2013-03-03"; $toDate="2013-03-11"; $fromDate = strtotime($fromDate); $toDate = strtotime($toDate); $diffDate = abs($toDate - $fromDate); echo $diffDateLast = round($diffDate / (60 * 60 * 24)); echo ">>>>>>>>".date("Y-m-d H:i:s"); echo ">>>>>>>>".date("Y-m-d",strtotime(date("Y-m-d",$toDate)." +1 day"));
Output for 5.6.28, 7.0.14 - 7.1.0
8>>>>>>>>2013-12-12 15:00:57>>>>>>>>2013-03-12
Output for 4.3.0 - 5.6.23, 7.0.0 - 7.0.8
8>>>>>>>>2013-12-12 15:00:07>>>>>>>>2013-03-12