Timezones in Date/Time Conditions
When comparing dates and times it is important to consider the timezone you want to compare with.
Relative Time Offsets
If your comparison date is relative (an offset of current time), such as "-1 day", "-36 hours", or "-1 week", the timezone setting is not needed because you are calculating time that has passed (not absolute time).
In this example, the timezone setting is not needed:
Absolute Dates & Times
Specifying the timezone only matters when using absolute dates and times, such as "January 1st 2020 12AM" or "yesterday 12AM". The system needs to know what timezone "12AM" is referring to. In your Shop's timezone, that may be calculated as you expect as 1/1/2020 12AM, and in another timezone it could be 12/31/2019 8PM or 1/1/2020 3AM.
When comparing dates/times you must consider if the date/time should be based on your personal timezone, your Shop's timezone, or the timezone of the field value you are comparing against.
The default assumption is that the comparison date is in the Shop's timezone.
In the following example we are saying the Order / Created At date must be before January 1st 2020 12AM in the Shop's timezone (which in this example is American/New_York or EST).
An order created on January 1st 2020 12AM GMT would NOT pass the condition because that date would be calculated as 1/1/20 5AM EST.
You can also base the comparison date on the timezone of the data you are comparing against. For example, if you are comparing "Order / Created At" dates, you could compare your date/time using the timezone of the order you are checking against.
In this example we are saying the Order / Created At date must be before January 1st 2020 12AM in the order's timezone.
Orders created on 12/31/2019 11:59PM GMT and 12/31/2019 11:59PM EST would both pass the condition because (relative to their own timezones) they come before 1/1/2020 12AM.
Still have questions? Send us a message and we'll help get you