3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateFormat3 = 'Y-m-d H:i:s'; $date1=date_create("2015-09-29 6:30:45AM"); $date2=date_create(date($dateFormat3)); $diff=date_diff($date1,$date2); echo $date2->format($dateFormat3) . "\n" . $diff->format("%m months, %d days, %H:%I:%S");
based on 4ovif
Output for 5.4.0 - 5.6.8, 5.6.10 - 7.2.0
2015-09-30 01:51:42 0 months, 0 days, 19:20:57
Output for 5.6.9
2015-09-30 01:51:43 0 months, 0 days, 19:20:58