Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When providing a DateTime object to isDue(), the TimeZone information is not respected / lost when it is formatted to a TimeZone agnostic timestamp at:
https://github.com/mtdowling/cron-expression/blob/v1.0.3/src/Cron/CronExpression.php#L243
We found out about this when processing incoming API requests (that are always in UTC) in a timezone different than UTC. The CRON checking mechanism 'converted' them to DateTimes in the local TimeZone however, resulting in unexpected behavior.
I think the preferred behavior would be to convert incoming DateTime objects to the local DateTimeZone first as described here: http://simonholywell.com/post/2013/12/convert-utc-to-local-time.html
Maybe the tests deserve some more attention.