Skip to content

Commit

Permalink
Merged branch '1.3' of ezsystems/ezplatform-kernel into 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Oct 18, 2022
2 parents ccdca7a + 6019e73 commit 65e8bd2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/bundle/Core/Command/UpdateTimestampsToUTCCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 65e8bd2

Please sign in to comment.