title: quartz scheduler get next scheduler time if the application stopped
body: <p>Currently i am using quartz scheduler in my application for executing scheduler. My application is running on a tomcat server. If the server was started then the scheduler will start firing the task based on the start time provided. </p>
  
  <p>My problem is if the task was scheduled to execute in interval basis for every 10 minutes and the tomcat was stopped for some reasons and it was resumed back after some two days then the quartz scheduler expression to get the nextvalid time is taking based on the start time provided, hence the scheduler jobs was back dated jobs..</p>
  
  <p><strong>Real time example :</strong></p>
  
  <p>The task was set to interval with the below cron expression for every 10 minutes.</p>
  
  <p><strong>0 0/10 * 1/1 * ? *</strong></p>
  
  <p>The start time for the job was </p>
  
  <p><strong>"2017-04-08 21:46:00"</strong></p>
  
  <p>But the application/tomcat server was started only on 10th april and after executing the scheduler the start time was changed to below format</p>
  
  <p><strong>"2017-04-08 21:56:00"</strong></p>
  
  <p>Only the time was incremented to 10 minutes and the date was not changed to 10th of April(today).</p>
  
  <p>Currently i am using the below code to fetch the next date/time for the scheduler</p>
  
  <pre><code>    CronExpression exp = new CronExpression(schedulerConfig.getCronexpression());
  
    NextschedulerDate = exp.getNextValidTimeAfter(Currentstartdate);
  </code></pre>
  
  <p>The same case is not working for weekday option. Kindly assist</p>