-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
CronExpression fails to calculate properly next execution when running on the day of winter daylight saving time #28095
Comments
We had an issue with Spring Boot 2.6.4 / Framework 5.3.16 on DST switch yesterday (March 27) The execution was just skipped when time was jumping from 2am to 3am. I've tried to...
Both didn't work - tried it by resetting system time to 01:59:30am. During debugging I found I've checked documentation as well as previous issues / fixes and couldn't find any specifics on how to properly handle this scenario where an execution falls into the "skipped" time frame between 2am ... 3am // edit: |
@mf81bln Please create a new issue instead of commenting on older, resolved issues. Feel free to ping me on said new issue. FWIW, this works fine for me: cronExpression = CronExpression.parse("0 30 2 * * ?"); // 01:59:30am
last = ZonedDateTime.parse("2022-03-26T01:59:30+01:00[Europe/Zurich]");
expected = ZonedDateTime.parse("2022-03-26T02:30:00+01:00[Europe/Zurich]");
actual = cronExpression.next(last);
assertThat(actual).isEqualTo(expected); |
@poutsma Sorry and thanks for your answer, I've created a new issue 👍 Your example works because it's running on March 26, switch to DST happened on Sunday, March 27 |
Affects: Spring Framework 5.3.16
The PR #28044 fixing the issue #28038 did cause a regression for winter daylight saving time
Problem: CronExpression fails to calculate properly next execution when running on the day of winter daylight saving time, just before DST is applied.
Here is a unit test case that you can add to
CronExpressionTests#daylightSaving
to reproduce the problem :Please note that in the previous version 5.3.15 everything worked fine for that case
The text was updated successfully, but these errors were encountered: