it is a interesting question. i am using Quartz.net to make job scheduler. also CronMaker is good for understanding crontrigger expressions. But i want to generate special day trigger. For example:
EXAMPLE1:
Run Times per 15 minutes :
03.04.2012 13:45 (starttime)
03.04.2012 14:00 (next run time)
Also
EXAMPLE2:
only one working : 03.04.2012 (13:45 only one )
How to write EXAMPLE1 and EXAMPLE2 cron expressions?
EXAMPLE1: Run Times per 15 minutes start from 13:45:00 and only run on 03-APR-2012
Create 2 Cron expressions:
EXAMPLE2: Run Times on 03-APR-2012 13:45:00 and run exactly once
EXAMPLE3: RUN Times from 03.04.2012 13:45:00 to 12.04.2012 15:45:00 per 15 minutes
It can be spilt into the following triggers:
For 03.04.2012 , use two trigger from Example 1
For 04.04.2012 – 11-04.2012 , use
For simplicity , I will use the
CronTriggerImplto build this schedule as it contains the method to set the start time and end time for a cron expression .In this way , I can make the cron expression that always repeats 15 minutes and set the start time and end time to limit this schedule to be executed in a defined date range.