Special Character L for day of week behaves differently in Quartz
See original GitHub issueAccording to Quartz using L for DoW is the last day (Saturday) in the week but cron-utils seems to return last Friday of the month. Am I doing something wrong or is this an issue?
@Test
public void lastDayOfTheWeek() throws Exception {
Cron cron = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ))
.parse("0 0 0 ? * L *");
ZoneId utc = ZoneId.of("UTC");
ZonedDateTime date = LocalDate.parse("2016-12-22").atStartOfDay(utc);
ZonedDateTime cronUtilsNextTime = ExecutionTime.forCron(cron).nextExecution(date);// 2016-12-30T00:00:00Z
org.quartz.CronExpression cronExpression = new org.quartz.CronExpression(cron.asString());
cronExpression.setTimeZone(TimeZone.getTimeZone(utc));
Date quartzNextTime = cronExpression.getNextValidTimeAfter(Date.from(date.toInstant()));// 2016-12-24T00:00:00Z
assertEquals(quartzNextTime.toInstant(), cronUtilsNextTime.toInstant()); // false
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Using the CronTrigger | Quartz.NET
The W character can only be specified when the day-of-month is a single day, not a range or list of days. TIP. The...
Read more >cron expression every 2 days not making sense for monday
Your cron schedule doesn't care about the day of the week. It is running simply on every uneven day of the month.
Read more >Cron Expression Reference - Sybase Infocenter
The "L" character has a different meaning in each of the two fields. For example, "L" in the day-of-month field means the last...
Read more >com.cronutils.parser.CronParser Java Examples
QUARTZ)); Cron cron = parser.parse(cronExpression); ExecutionTime ... Special Character L for day of week behaves differently in Quartz * @throws ...
Read more >Cron Expressions
("last") This character has different meaning in day of month and day of week. For example, the value "L" in the day-of-month field...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@laxgoalie392 Fixed! Kudos to @meincs for this!
@laxgoalie392 @meincs version 6.0.0 was released with this.