function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mrunali GaonkarMrunali Gaonkar 

Scheduled dates from cron expression

hi,
I want to write a code to get next Scheduled dates from given cron expression.For eg.
If input is : 0 0 20 * * ?
then output should be: Wednesday, May 27, 2015 8:00 PM
                                  Thursday, May 28, 2015 8:00 PM
                                  Friday, May 29, 2015 8:00 PM
                                  .
                                  .etc.
Please help to resolve this.
Thank you.
 
NaveenReddyNaveenReddy
Hi Mrunali,
  We need to get the date and time from cronexpression by conditioning each value in the expression.
see this may helpful.
http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger

http://www.cronmaker.com/


If there are scheduled jobs exists
 
SELECT StartTime,PreviousFireTime,NextFireTime,EndTime,CronJobDetailId,TimesTriggered,CronExpression FROM CronTrigger Where CronJobDetailId In (Select Id from CronJobDetail where Name='YourJobName')

Thanks,
Naveen.