<?php
$datatime1 = new DateTime('2015/04/15 00:00:00');
$datatime2 = new DateTime('2015/05/16 00:00:00');
$data1 = $datatime1->format('Y-m-d H:i:s');
$data2 = $datatime2->format('Y-m-d H:i:s');
$diff = $datatime1->diff($datatime2);
$horas = $diff->h + ($diff->days * 24);
echo "A diferença de horas entre {$data1} e {$data2} é {$horas} horas";
PD9waHAKCiRkYXRhdGltZTEgPSBuZXcgRGF0ZVRpbWUoJzIwMTUvMDQvMTUgMDA6MDA6MDAnKTsKJGRhdGF0aW1lMiA9IG5ldyBEYXRlVGltZSgnMjAxNS8wNS8xNiAwMDowMDowMCcpOwoKJGRhdGExICA9ICRkYXRhdGltZTEtPmZvcm1hdCgnWS1tLWQgSDppOnMnKTsKJGRhdGEyICA9ICRkYXRhdGltZTItPmZvcm1hdCgnWS1tLWQgSDppOnMnKTsKCiRkaWZmID0gJGRhdGF0aW1lMS0+ZGlmZigkZGF0YXRpbWUyKTsKJGhvcmFzID0gJGRpZmYtPmggKyAoJGRpZmYtPmRheXMgKiAyNCk7CgplY2hvICJBIGRpZmVyZW7Dp2EgZGUgaG9yYXMgZW50cmUgeyRkYXRhMX0gZSB7JGRhdGEyfSDDqSB7JGhvcmFzfSBob3JhcyI7Cg==