diff --git a/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php b/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php index 43d25441d8..3a7fc01c08 100644 --- a/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php +++ b/src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php @@ -232,9 +232,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $processScriptFragments[] = '--dry-run'; } - $process = new Process( - implode(' ', $processScriptFragments) - ); + $process = new Process($processScriptFragments); $process->setEnv(['INNER_CALL' => 1]); $process->run(); @@ -272,7 +270,7 @@ protected function processTimestamps($offset, $limit, $output) $dateTimeInUTC->setTimezone(new DateTimeZone('UTC')); foreach ($timestampBasedFields as $timestampBasedField) { - $timestamp = $timestampBasedField['data_int']; + $timestamp = (int)$timestampBasedField['data_int']; $dateTimeInUTC->setTimestamp($timestamp); $newTimestamp = $this->convertToUtcTimestamp($timestamp); @@ -373,7 +371,7 @@ protected function convertToUtcTimestamp($timestamp) $dateTimeZone = new DateTimeZone($this->timezone); $dateTimeZoneUTC = new DateTimeZone('UTC'); - $dateTime = new DateTime(null, $dateTimeZone); + $dateTime = new DateTime('now', $dateTimeZone); $dateTime->setTimestamp($timestamp); $dateTimeUTC = new DateTime($dateTime->format('Y-m-d H:i:s'), $dateTimeZoneUTC);