Closed
Description
Affects: Spring Framework 5.3.1
Problem: Scheduled task marked with the annotation @Scheduled(cron = ""0 0 9 * * *"", zone = "Europe/Amsterdam")
did not run on March 28
Expected behaviour: The scheduled task should have run on March 28
How to reproduce: The bug seems to be related to the class CronExpression
introduced in version 5.3
ZonedDateTime current = ZonedDateTime.of(LocalDateTime.parse("2021-03-27T09:00:00"), ZoneId.of("Europe/Amsterdam"));
CronExpression cronExpression = CronExpression.parse("0 0 9 * * *");
ZonedDateTime next = cronExpression.next(current);
In this case the value returned by cronExpression.next()
is 2021-03-29T09:00:00
instead of the expected 2021-03-28T09:00:00