<?php
$interval = new DateInterval('PT1H');
// DST change in Europe is on the 30. October 2016
$dateTimeStart = new DateTimeImmutable('2016-10-30 01:30:00', new DateTimezone('Europe/Berlin'));
$dateTimeEnd = new DateTimeImmutable('2016-10-30 03:31:00', new DateTimezone('Europe/Berlin'));
$period = new DatePeriod($dateTimeStart, $interval, $dateTimeEnd);
foreach ($period as $date) {
echo $date->format('c') . "\n";
}
Fatal error: Uncaught exception 'Exception' with message 'DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.' in /in/2aDp3:8
Stack trace:
#0 /in/2aDp3(8): DatePeriod->__construct(Object(DateTimeImmutable), Object(DateInterval), Object(DateTimeImmutable))
#1 {main}
thrown in /in/2aDp3 on line 8
Process exited with code 255.