1

I am creating order programmatically on magento 2.2 and using this

$order = $this->orderRepository->get($order_id);
$order->setCreatedAt($orderData['created_at']); 
$order->save();

where $this->orderRepository referes to \Magento\Sales\Api\OrderRepositoryInterface $orderRepository

The created_date comes from an excel and has the date (2019-01-11 18:43:08) , but created_at coloumn under sales_order it is saved as 2019-01-12 00:13:07 . enter image description here

. Here are the timezone settings that i have in backend enter image description here

I need to have the same dates in order that i have in csv and and same need to be reflected on other places like order grid. Please advice

  • which version you have using? – Amit Bera Feb 20 at 7:46
  • Hi amit i am using magento 2.2.5 – Kumar Feb 21 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.