I would like check how iteration is between two dates with interval 30 minutes.
I have for example:
$one = new DateTime('2012-01-20 06:00');
$two = new DateTime('2012-01-20 17:30');
$first = $one->format('H:i');
$second = $two->format('H:i');
$interval = 30;
In this example $iteration = 23, but how can i calculate this?
You divide the amount of minutes between the datetimes with the desired interval.
(I’ve taken a shortcut and am divided the amount of seconds by amount of seconds in 30 minutes)