Skip to content
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

Initial different timezone support #48

Merged
merged 2 commits into from
Apr 29, 2014
Merged

Initial different timezone support #48

merged 2 commits into from
Apr 29, 2014

Conversation

holtkamp
Copy link

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.

@holtkamp holtkamp changed the title Patch different timezone support Initial different timezone support Apr 15, 2014
mtdowling added a commit that referenced this pull request Apr 29, 2014
@mtdowling mtdowling merged commit 6fcc276 into mtdowling:master Apr 29, 2014
@holtkamp
Copy link
Author

Nice, can you consider tagging the current master branch, so people can refer to a 'stable' version using composer? Thanks!

@holtkamp holtkamp deleted the patch-different-timezone-support branch April 29, 2014 13:16
@mtdowling
Copy link
Owner

I will, but I'm working on a couple other issues first.

On Apr 29, 2014, at 6:16 AM, Menno Holtkamp notifications@github.com wrote:

Nice, can you consider tagging the current master branch, so people can refer to a 'stable' version using composer? Thanks!


Reply to this email directly or view it on GitHub.

@mnapoli mnapoli mentioned this pull request Jan 4, 2015
peter279k pushed a commit to peter279k/cron-expression that referenced this pull request Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants