Fix timezone conversion for stepped cron expressions#60870
Closed
egknight wants to merge 1 commit into
Closed
Conversation
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
everyFourHours()during British Summer Time and update the existing stepped-hour cases.Background
schedule:listcurrently passes stepped fields such as*/4and1-23/2through timezone conversion unchanged. This changes the real execution times when the event timezone differs from the display timezone.For example,
0 */4 * * *inEurope/Londonduring British Summer Time should be represented in UTC as:Instead, it is currently returned as
0 */4 * * *. Consumers of the JSON schedule can therefore invoke the scheduler at the wrong UTC hours, after which Laravel's timezone-aware due check rejects the event.This change expands supported numeric step syntax into explicit values before passing those values through the converter's existing offset and carry logic. Plain numeric fields retain their current behavior, while unsupported cron syntax continues to pass through unchanged.
Tests
vendor/bin/phpunit tests/Integration/Console/Scheduling/ScheduleListCommandTest.phpvendor/bin/pint src/Illuminate/Console/Scheduling/CronExpressionTimezoneConverter.php tests/Integration/Console/Scheduling/ScheduleListCommandTest.php