From 923769278217945f4ece12b356c4cfcbb484d7bd Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 11 Dec 2013 14:45:16 -0500 Subject: [PATCH] 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. --- airtime_mvc/application/services/ShowService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 5858907f9..cd4b43225 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -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); }