<?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);
You have javascript disabled. You will not be able to edit any code.