1

I want to schedule my apex class to run twice a day, i.e 8 AM and 8 PM How this can be achieved? What will be the desired cron expression?

2

I have found the solution:

String sch = '0 0 11/12 * * ?';
//0 0 {time to schedule}/{hours until repeat} * * ?
0

This also works:

String cron = '0 00 08,20 * * ?';

Runs at 0800h and at 2000h every day

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.