- explode: documentation ( source)
- strtotime: documentation ( source)
- gmdate: documentation ( source)
<?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;