You could use Cron expressions. Tutorial here: http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-06
CronTrigger Example 2 - an expression to create a trigger that fires every 5 minutes, at 10 seconds after the minute (i.e. 10:00:10 am, 10:05:10 am, etc.).
"10 0/5 * * * ?"
There are also sites helping to create Cron expressions http://www.abunchofutils.com/utils/developer/cron-expression-helper/
The expression */20 9-11 * * *
triggers every 20 minutes between 9 and 12, but it won't trigger at 12:00.
Or you can use a DailyTimeIntervalScheduleBuilder
:
Trigger trigger = DailyTimeIntervalScheduleBuilder.dailyTimeIntervalSchedule()
.onEveryDay()
.startingDailyAt(TimeOfDay.hourAndMinuteOfDay(9, 0))
.endingDailyAt(TimeOfDay.hourAndMinuteOfDay(12, 0))
.withIntervalInMinutes(20)
.build();