0

enter image description hereI have a scheduler with the CRON expression as

0 30 13 5-5 9-10  ?  2018-2018

From the above my thinking is it will run from sep 5th to oct 5th of 2018. But it's breaking in month end. Is there a way to check for all iterations of CRON in apex?

enter image description here

1 Answer 1

2

Not in Apex, but tools like this site can help you figure it out. Note that what you're trying to do is impossible; your expression, as read, will only work at 1:30 PM on the 5th of September and October, 2018 (two times total). Each element of the CRON expression must independently match, so you can't specify a start/end date that way with a simple CRON expression. In this case, it'd be better to use the scheduling user interface, which allows you to specify proper start/end dates. As a CRON expression, you'd need two jobs, the first describing runs from the 5th of September to the end of the month, then a second for October from the first through the 5th:

0 30 13 5-31 * ? 2018
0 30 13 1-5 * ? 2018
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .