Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento API returns dates in what timezone

I have been trying to find the answer to this for several hours... what timezone does the Magento API use? I am assuming that the Magento API returns all date values as GMT time because they do not append the timezone string at the end of the data. Is this correct?

I am wanting to use filters and want to make sure that the dates are being correctly interpreted in my offsite client.

like image 355
pmobley Avatar asked Mar 29 '11 01:03

pmobley


People also ask

How do I change the timezone in Magento 2?

Step 1: Login to your Magento 2 backend Then under Settings , choose Configuration . In the panel on the left under General , choose General . Expand the Locale Options section. Select your Timezone from the list.

How can I get current date in Magento 2?

In your construct you need to inject class \Magento\Framework\Stdlib\DateTime\DateTime. After that,gmtDate() function will return current GMT Date Time. You can use this code in your block file or any other files. Here, getCurrentGMTDateTime() function will return current GMT Date Time.


1 Answers

From my experience, all dates in Magento seem to be stored in GMT. You should be able to confirm this trivially in any particular case by adding a record at a known time and calculating the offset.

like image 120
Joe Mastey Avatar answered Oct 14 '22 21:10

Joe Mastey