we are facing a strange behavior for value of updated_at saved in db table sales_order. Server timezone is CEST, updated_at date therefor is saved in CEST to database. This is validated. Default config timezone is "Europe/Berlin".
Cron job collects orders with specific state via resource collection to manipulate them. Debugging updated_at value by looping result set prints value/date in UTC, its -2h. This runs in "crontab" environment/area. This happens (in loop) for all those calls:
echo $order->getUpdatedAt();
echo $order->getData('updated_at');
echo $order->getOrigData('updated_at');
//Collection load
$criteria = $this->criteriaBuilder->addFilter('state', Order::STATE_PAYMENT_REVIEW)->create();
$items = $this->orderRepository->getList($criteria)->getItems();
We checked mostly every possibility why and how this transformation happens but we didn't find any hint in code. We found no after collection load observer or any other forced transformation. Magento folks, what could cause this behavior?
Thanks in advance
criteriaBuilder
section.