Cron expression with start and end time

后端 未结 4 1899
南笙
南笙 2021-01-19 00:15

I am trying to write an cron expression with a specific start time and end time everyday. i.e. every minute from 10:15 to 17:35 everyday

One possible solution for t

4条回答
  •  醉梦人生
    2021-01-19 01:08

    There is no other way to achieve it using single crone expression but to specify multiple crone expressions for specific startDate and endDate. There is a slight modification in second crone expression though (highlighted one)

    0 15-59 10 * * * (Every minute between 10:15 AM and 10:59 AM)

    0 * 11-16 * * * (Every minute, between 11:00 AM and 04:59 PM)

    0 0-35 17 * * * (Every minute between 05:00 PM and 05:35 PM)

提交回复
热议问题