Commit 0fc02569 authored by Kevin Duret's avatar Kevin Duret Committed by loiclau

fix(back): avoid php notice when poller has not timezone (#6031)

parent 12dcc759
......@@ -356,8 +356,9 @@ class CentreonGMT
public function getHostCurrentDatetime($host_id, $date_format = 'c')
$locations = $this->getHostLocations();
$timezone = isset($locations[$host_id]) ? $locations[$host_id] : '';
$sDate = new DateTime();
$sDate->setTimezone(new DateTimeZone($this->getActiveTimezone($locations[$host_id])));
$sDate->setTimezone(new DateTimeZone($this->getActiveTimezone($timezone)));
return $sDate;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment