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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With