Commit cf74171a authored by Arnaud Pauget's avatar Arnaud Pauget
Browse files

fix (14783) : change dateTime construction for the current time variable

parent ae2ff6f7
Pipeline #9386 failed with stages
......@@ -199,7 +199,8 @@ class scheduling
}
if ($status) {
$scheduling->lastExecution = \laabs::newDateTime(null, 'UTC');
$scheduling->lastExecution = \laabs::newDateTime();
$scheduling->lastExecution->setTimezone(new \DateTimeZone('UTC'));
$scheduling->status = "scheduled";
$frequency = explode(";", $scheduling->frequency);
......@@ -231,7 +232,8 @@ class scheduling
public function process()
{
$schedulings = $this->sdoFactory->find("batchProcessing/scheduling");
$currentDate = \laabs::newDateTime(null, 'UTC');
$currentDate = \laabs::newDateTime();
$currentDate->setTimezone(new \DateTimeZone('UTC'));
$res = [];
......@@ -242,11 +244,11 @@ class scheduling
continue;
}
if (empty($scheduling->nextExecution)) {
$frequency = explode(";", $scheduling->frequency);
$scheduling->nextExecution = $this->nextExecution($frequency);
$this->sdoFactory->update($scheduling,"batchProcessing/scheduling");
}
// if (empty($scheduling->nextExecution)) {
// $frequency = explode(";", $scheduling->frequency);
// $scheduling->nextExecution = $this->nextExecution($frequency);
// $this->sdoFactory->update($scheduling,"batchProcessing/scheduling");
// }
$interval = $scheduling->nextExecution->getTimestamp() - $currentDate->getTimestamp();
......@@ -296,8 +298,11 @@ class scheduling
*/
private function nextExecution($frequency)
{
$currentDate = \laabs::newDateTime(null, 'UTC');
$endDate = \laabs::newDateTime(null, 'UTC');
$currentDate = \laabs::newDateTime();
$endDate = \laabs::newDateTime();
$currentDate->setTimezone(new \DateTimeZone('UTC'));
$endDate->setTimezone(new \DateTimeZone('UTC'));
$UTC_Offset = date('Z');
$H_Offset = $UTC_Offset/3600;
......
Supports Markdown
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