-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to pass DateTime with custom TimeZone to isDue #78
Comments
I don't remember exactly why this was added really. This is what I got from the blame: cbde1b5 I guess it's trying to normalize the timezone. I'm happy to make a change if needed. |
It appears we can maybe work around it on our end as well by passing a string representation instead of a DateTime object, though it does seem intuitively like the Timezone of the given DateTime object should be respected. |
Maybe I'm wrong there. Here is the PR someone is working on our side (laravel/framework#7636) ... personally I kind of wonder if it should be fixed over here though. |
I agree it should be fixed here. The library shouldn't be changing the timezone without giving the user the option to specify the timezone it changes to. It's very important to use the correct timezone when checking to see if a cron expression is due since the expressions themselves are not timezone-aware. If you create expressions for GMT-8:00, then the library will always be off by 8 hours if it's converting any DateTimes to GMT/UTC. I remember a year or so ago, I modified my local copy of the library to accept an optional timezone in the I think it'd be most useful to allow providing a default timezone in the I could probably work on this this weekend, if you'd like. |
Looks like this is not handled consistently across all of the public API. |
Is there a suggested fix for this? Anything I can do? |
It can be fixed. We need a PR that removes all of the timezone modifications from the library and any time a DateTime object will be modified, it's cloned. |
We fixed it on our end for now by passing a string representation of the On Thu, Mar 26, 2015 at 11:38 AM, Michael Dowling notifications@github.com
|
@mtdowling @dragonmantank - it looks like someone has made a PR for this issue here #115 Any chance of reviewing it - and potentially merging? I've run into the same issue as @taylorotwell (ironically for inside a Laravel application) that I really need to support custom timezones... |
This should have been corrected with #134, so closing. |
This commit is part of a campaign to reduce the amount of data transferred to save global bandwidth and reduce the amount of CO2. See Codeception/Codeception#5527 for more info.
In Laravel's scheduler component, we allow the user to specify a Timezone to evaluate the Cron against. However, cron-expression appears to always overwrite the timezone to the current application timezone, allowing no custom timezone to be set.
Is there any way this can be resolved?
The text was updated successfully, but these errors were encountered: