3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //round pour le changement d'heure $debut = mktime(0, 0, 0, 10, 27, 2013); //$fin = mktime(23, 0, 0, 10, 27, 2013); echo date('H:i:s d/m/Y',strtotime('+10 hours',$debut))."\n"; $debut = mktime(5, 0, 0, 10, 27, 2013); //$fin = mktime(23, 0, 0, 10, 27, 2013); echo date('H:i:s d/m/Y',strtotime('+10 hours',$debut))."\n"; /* $d1 = new DateTime ('now',new DateTimeZone('Europe/Paris')); $d2 = new DateTime ('now',new DateTimeZone('Europe/Paris')); $d1->setTimestamp($debut); $d2->setTimestamp($fin); $diff = $d1->diff($d2); print_r($diff); $d3 = $d1->add($diff); print_r($d3); */
Output for 5.1.0 - 7.1.0
10:00:00 27/10/2013 15:00:00 27/10/2013
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.0.5
09:00:00 27/10/2013 15:00:00 27/10/2013
Output for 5.0.0 - 5.0.2
09:00:00 27/10/2013 10:00:00 27/10/2013