Answer the question
In order to leave comments, you need to log in
Quartz cron expression - set start and end times?
Good day ... I
need the ability in Java to run tasks that would be scheduled at a certain interval, I tried the quartz library for this, using Cron Expressions, but they are not suitable for all cases ... For example, you need to run a task every day from 18.20 to 22.50 every 5 minutes…
Please advise either a library that could do this, or some methods that can be used to create Cron Expression for such cases… Thanks in advance…
Answer the question
In order to leave comments, you need to log in
In the job itself, check that 18:20 <= new Date() <= 22:50
After that, create a task with an interval: 0 0/5 18,19,20,21,22 * *?
This means to run every 5 minutes. from [18 to 23) hours.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question