- round: documentation ( source)
- iterator_count: documentation ( source)
<?php
$start = new DateTime('2017-09-01 23:00:00');
$stop = new DateTime('2017-09-02 01:34:00');
$hours = iterator_count(new DatePeriod($start, new DateInterval('PT1S'), $stop)) / 3600;
echo round($hours, 2);