+ Start a Discussion
billing badgebilling badge 

help on scheduling a class

Hi All,

Need a help,

1) want to run the class from 8 Am to 2 PM everyday
2) and want to run the class from 5PM to 3 AM Everyday.
any ideas on cron expression. 

AbhishekAbhishek (Salesforce Developers) 
The below trailhead will help with your requirement,


I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

mukesh guptamukesh gupta
Hi bage,

As per your requirment, we can set only starting time of scheduler , we can't decide end time of job beucase it's depand on resourse avalibility and record size.
So i think you should set only start time.

If you need any discussion please let me know.

If this solution is usefull for you, Please mark as a Best Answer to help others.


gaurav gupta 253gaurav gupta 253
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String sch = '20 30 8 10 2 ?';

You can mention only start time..