CC-5630: Shows created on a DST border get scheduled an extra hour longer
The show start and end time need to be in the show's local timezone when adding or subtracting time to the start and end time (in case of DST crossings). In this case the end time was already converted to UTC when we tried to change the time.
This commit is contained in:
parent
0598c46387
commit
9237692782
1 changed files with 3 additions and 2 deletions
|
@ -1608,14 +1608,15 @@ SQL;
|
|||
$offset["hours"].":".$offset["mins"], $timezone);
|
||||
$startDateTime->add(new DateInterval("P{$offset["days"]}D"));
|
||||
}
|
||||
//convert time to UTC
|
||||
$startDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
|
||||
$endDateTime = clone $startDateTime;
|
||||
$duration = explode(":", $duration);
|
||||
list($hours, $mins) = array_slice($duration, 0, 2);
|
||||
$endDateTime->add(new DateInterval("PT{$hours}H{$mins}M"));
|
||||
|
||||
$startDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
$endDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
|
||||
return array($startDateTime, $endDateTime);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue