Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(downtime): remove useless clone
Browse files Browse the repository at this point in the history
  • Loading branch information
kduret authored Oct 16, 2017
1 parent 79502bb commit 39ebc27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions www/class/centreonExternalCommand.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $st
$dateTime = new \DateTime($date, new \DateTimeZone($timezone));

// Winter to summer dst
$dateTime2 = clone($dateTime);
$dateTime2 = $dateTime;
$dateTime2->setTimestamp($dateTime2->getTimestamp());
if ($dateTime2->format("H") != $dateTime->format("H")) {
$hour = $dateTime->format('H');
Expand All @@ -414,7 +414,7 @@ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $st
}

// Summer to winter dst
$dateTime3 = clone($dateTime);
$dateTime3 = $dateTime;
$dateTime3 = $dateTime3->setTimestamp($dateTime3->getTimestamp() - 3600);
if ($dateTime3->getTimestamp() == $dateTime->getTimestamp()) {
if ($start) {
Expand All @@ -424,7 +424,7 @@ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $st
}
}

$dateTime4 = clone($dateTime);
$dateTime4 = $dateTime;
$dateTime4 = $dateTime3->setTimestamp($dateTime4->getTimestamp() + 3600);
if ($dateTime4->getTimestamp() == $dateTime->getTimestamp()) {
if ($start) {
Expand Down

0 comments on commit 39ebc27

Please sign in to comment.