Skip to content

Commit 537c32b

Browse files
authored
Merge pull request #1557 from algolia/bugfix/MAGE-909
MAGE-909: algoliaLastUpdateAtCET time changed to UTC timestamp
2 parents 344499c + c4352ab commit 537c32b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Helper/AlgoliaHelper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,12 +585,13 @@ public function waitLastTask(string $lastUsedIndexName = null, int $lastTaskId =
585585
*/
586586
protected function prepareRecords(array &$objects, string $indexName): void
587587
{
588-
$currentCET = new \DateTime('now', new \DateTimeZone('Europe/Paris'));
589-
$currentCET = $currentCET->format('Y-m-d H:i:s');
588+
$currentCET = strtotime('now');
590589

591590
$modifiedIds = [];
592591
foreach ($objects as $key => &$object) {
593592
$object['algoliaLastUpdateAtCET'] = $currentCET;
593+
// Convert created_at to UTC timestamp
594+
$object['created_at'] = strtotime($object['created_at']);
594595

595596
$previousObject = $object;
596597

0 commit comments

Comments
 (0)