You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling this method across a timezone change, it returns a valid time instead of the next invalid time. This occurs when the input date is before a clock change, and the next invalid time is after a clock change.
For example, given a CronExpression with a timezone ID of "Europe/London", and the expression "* * * ? * 1", calling nextInvalidTimeAfter with a date of 2023-10-29T00:00:00+01:00 returns a date of 2023-10-29T01:00:00.000+0100. Expected value should be 2023-10-30T00:00Z.
Here's an example in code:
CronExpression cronExpression = new CronExpression("* * * ? * 1");
cronExpression.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Europe/London")));
Date date = Date.from(Instant.parse("2023-10-29T00:00:00+01:00"));
Date nextInvalidTime = cronExpression.getNextInvalidTimeAfter(date);
assertFalse(cronExpression.isSatisfiedBy(nextInvalidTime)); // fails
assertEquals(nextInvalidTime, Date.from(Instant.parse("2023-10-30T00:00:00Z"))); // fails; actual: 2023-10-29T01:00:00+01:00
The text was updated successfully, but these errors were encountered:
When calling this method across a timezone change, it returns a valid time instead of the next invalid time. This occurs when the input date is before a clock change, and the next invalid time is after a clock change.
For example, given a CronExpression with a timezone ID of "Europe/London", and the expression "* * * ? * 1", calling
nextInvalidTimeAfter
with a date of 2023-10-29T00:00:00+01:00 returns a date of 2023-10-29T01:00:00.000+0100. Expected value should be 2023-10-30T00:00Z.Here's an example in code:
The text was updated successfully, but these errors were encountered: