3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime("20150717T090000Z"); $dt->setTimeZone( new DateTimezone('Europe/Berlin') ); $dta=explode("T",$dt->format(DateTime::ATOM)); $dtb=explode("+",$dta[1]); $dt = new DateTime("20150717T100000Z"); $dt->setTimeZone( new DateTimezone('Europe/Berlin') ); $dtc=explode("T",$dt->format(DateTime::ATOM)); $dtd=explode("+",$dtc[1]); $h1=strtotime($dtd[0]); $h2=strtotime($dtc[0]); $h=gmdate('H',$h1-$h2); $i = gmdate('i',$h1-$h2); echo $dtd[0]; $duration = (int)$h*60 + (int)$i; //echo $duration;

preferences:
55.56 ms | 402 KiB | 5 Q