Skip to content

CronExpression skips a temporal when last day of the month and * expression is used #26390

@m15o

Description

@m15o

Combining last day of the month with * may cause a temporal to be skipped depending on the seed time.

var everyHourLastDayOfTheMonth = CronExpression.parse("0 0 * L * *");
System.out.println(everyHourLastDayOfTheMonth.next(OffsetDateTime.parse("2021-01-30T00:00:00Z")));
System.out.println(everyHourLastDayOfTheMonth.next(OffsetDateTime.parse("2021-01-30T23:00:00Z")));

Actual:

2021-01-31T01:00Z
2021-01-31T00:00Z

Expected:

2021-01-31T00:00Z
2021-01-31T00:00Z

Affects: 5.3.3

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions