Skip to content
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

Incorrect executionTime #631

Open
sunshine7690 opened this issue Oct 12, 2024 · 0 comments
Open

Incorrect executionTime #631

sunshine7690 opened this issue Oct 12, 2024 · 0 comments

Comments

@sunshine7690
Copy link

public static void main(String[] args) {
CronDefinition definition = CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ);
CronParser parser = new CronParser(definition);
Cron cron = parser.parse("*/8 * * * * ?");
ExecutionTime executionTime = ExecutionTime.forCron(cron);
ZonedDateTime now = ZonedDateTime.of(2024, 9, 12, 10, 46, 57, 0, ZoneOffset.UTC);
System.out.println("now "+now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
now = executionTime.nextExecution(now).get();
System.out.println(" nextExecution "+ now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
}

Run the code. result is:
now 2024-09-12 10:46:57
nextExecution 2024-09-12 10:47:00

During cross-minute, the next execution time is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant