maya5510
maya5510

Reputation: 27

Magento 2.3.4 Different hour in REST API

I send request via REST API

https://www.mysite.pl/rest/V1/orders/89

And have date and time: "created_at": "2021-09-21 15:59:34",

When I go to Saels->Orders in admin there is different data and time: "Sep 21, 2021, 5:59:34 PM"

So there is a 2 hours difference. I think this cause a problem with my payment module. In admin timezone is set to CET Warsaw. Why in REST API call there is other time ?

Upvotes: 1

Views: 435

Answers (2)

bfontaine
bfontaine

Reputation: 19850

This is because the API uses the timezone of the server (usually UTC), while the admin uses the one you configured for the store(s). You can use different timezones for different stores.

Upvotes: 0

Hassan Ali Shahzad
Hassan Ali Shahzad

Reputation: 2734

I fixed this issue for me by selecting the "Coordinated Universal time" in admin: Store -> configuration -> General -> General -> Local Options enter image description here

Upvotes: 1

Related Questions