title: Quartz.net: Run a job for specific interval of time
body: <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using Quartz;
  using Quartz.Impl;
  using Quartz.Job;
  using ConsoleApplication2;
  
  namespace Lesson1
  {
      class Program
      {
          static void Main(string[] args)
         {
              //Create the scheduler factory
              ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
  
              //Ask the scheduler factory for a scheduler
              IScheduler scheduler = schedulerFactory.GetScheduler();
  
              //Start the scheduler so that it can start executing jobs
              scheduler.Start();
  
              // Create a job of Type WriteToConsoleJob
              IJobDetail job = JobBuilder.Create(typeof(WriteToConsoleJob)).Build();
  
              ITrigger trigger = TriggerBuilder.Create().WithDailyTimeIntervalSchedule(s =&gt; s.WithIntervalInMinutes(15).OnMondayThroughFriday().StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(9, 0))).Build();
  
  
              scheduler.ScheduleJob(job, trigger);
  
  
              //A nice way to stop the scheduler, waiting for jobs that are running to finish
              scheduler.Shutdown(true);
          }
      }
  }
  </code></pre>
  
  <p>I have created a test job and its working fine for weekdays repeating after 15 minutes starting at 0900 hours but i want to run it for specific interval of time i.e. 0900 to 1500 hours. 
  And i don't want to use CronTrigger for this. </p>