CC-3083 Must convert to UTC start/end times using the timezone start/end times
This commit is contained in:
parent
ab98bad5b4
commit
87886b039f
1 changed files with 9 additions and 11 deletions
|
@ -1251,16 +1251,14 @@ class Application_Model_Show {
|
||||||
if (isset($p_offset)) {
|
if (isset($p_offset)) {
|
||||||
$startDateTime->add(new DateInterval("P{$p_offset["days"]}DT{$p_offset["hours"]}H{$p_offset["mins"]}M"));
|
$startDateTime->add(new DateInterval("P{$p_offset["days"]}DT{$p_offset["hours"]}H{$p_offset["mins"]}M"));
|
||||||
}
|
}
|
||||||
|
//convert time to UTC
|
||||||
|
$startDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||||
|
|
||||||
$endDateTime = new DateTime($startDateTime->format("Y-m-d H:i:s"), new DateTimeZone($timezone));
|
$endDateTime = clone $startDateTime;
|
||||||
$duration = explode(":", $p_duration);
|
$duration = explode(":", $p_duration);
|
||||||
list($hours, $mins) = array_slice($duration, 0, 2);
|
list($hours, $mins) = array_slice($duration, 0, 2);
|
||||||
$endDateTime->add(new DateInterval("PT{$hours}H{$mins}M"));
|
$endDateTime->add(new DateInterval("PT{$hours}H{$mins}M"));
|
||||||
|
|
||||||
//convert times to UTC
|
|
||||||
$startDateTime->setTimezone(new DateTimeZone('UTC'));
|
|
||||||
$endDateTime->setTimezone(new DateTimeZone('UTC'));
|
|
||||||
|
|
||||||
return array($startDateTime, $endDateTime);
|
return array($startDateTime, $endDateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue