site has timezone set.
created a date field.
Dates get stored in the DB in local time.
Scheduler component uses that date field, expects time to be in UTC, but it is stored in local time --> scheduled item is off by the difference.

As I understand it this is a bug in scheduler. Please correct me if I am wrong.

If it is a bug, would the devs be willing to accept a patch?

Thanks,
Shiraz

Comments

fago’s picture

Status: Active » Postponed (maintainer needs more info)

How have you configured your scheduler? Using data-selection or maybe by using tokens?

shiraz dindar’s picture

Hi Fago,

Thank you for your response, all your coding work on entities, and especially your attention to the issue queues!

The goal is to send out an email 5 days before a date as set in a field.

The scheduler component has a "scheduled evaluation date" using a data-selector of the date field. There is no direct input for this, thus no token availability.

Below that, in the "add offset" section, I have -5 days. But, as mentioned, it is subtracting 5 days from the date with the expectation that it is stored in GMT, when in fact it is stored in local time.

In the offset section, there is the option to use direct input with a value that gets fed straight into strtotime(), and as the context help says, one can use strtotime's offsetting directly, but here too strtotime() is expecting a GMT date, as also stated in the context help.

But you know, the more I think about this, the more I realize that it's understandable that rules expects dates to be stored in GMT/UTC. Trying to patch rules to account for timezone would mean that it would have to find out from date how a given date field is stored, which may not be trivial. I'm going to call this issue null, and simply change my date fields to store via UTC....

Thanks for your attention in any case!!

Shiraz

shiraz dindar’s picture

Category: bug » feature
Status: Postponed (maintainer needs more info) » Closed (won't fix)