Besides some random community post answers, I cannot find ANY documentation on the behavior of the Shopify Query Language filter paramters for TIME ZONES, nor can I find (anywhere!!!) information about proper standard/format of the time fields. Depending on the format of the timestamp I pass the to the API, I get wildly different query results in both the REST and GraphQL APIs.
PLEASE make available the preferred way of dealing with time in the APIs and Shopify Query Language.
If you look at something that accepts a date filter (e.g. https://help.shopify.com/en/api/reference/orders/order#index) you'll notice they provide the format in the example: 2014-04-25T16:15:47-04:00
This is the ISO 8601 format, which includes a timezone offset. Personally I always send query parameters in UTC so that would be something like 2019-06-22T11:05:00Z
Thanks for the quick relpy, Gavin. I either did not look at or did not notice this in the REST documentation (was primarily working in GraphQL).
Here’s some questions for the API/documentation team though:
Timestamp GraphQL Gem/REST ---------------------------------- --------- ---------- Fri, 21 Jun 2019 11:26:23 -0400 3 66 2019-06-21 15:26:23 UTC 0 66 "2019-06-21T11:26:23-04:00" 3 66 "2019-06-21T15:26:23Z" 85 66
"timezone"=>"(GMT-05:00) America/New_York", "iana_timezone"=>"America/New_York",(I mean...: lol) -- The API itself suggests the wrong offset? https://www.timeanddate.com/time/gmt-utc-time.html
This is just bananas. With my dev environment in EDT (UTC-0400,) Store in GMT-0500 according to API (?), our production server in UTC, AND the API not even doing offsets correctly AND loosely accepting all different formats, it is basically impossible to write good queries without better documentation.
What about the other undocumented thing from the community answers where requests supposedly have to be formatted with the same time zones as the store is set to? (Ie, it doesn’t convert back and forth from UTC times? Again, why use ISO8601 at all?).
Thank you for posting this, Stephen, I thought I was going crazy.
It seems that the offset is simply ignored and all date times have to be formatted with the same time zone as the store.
I don't even want to know what happens if the store owner changes the shop's time zone ....