Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9151723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:52:19+00:00 2026-06-17T11:52:19+00:00

I am new to Quartz and want to use it to schedule scripts in

  • 0

I am new to Quartz and want to use it to schedule scripts in SQLServer using a service for clients using SQL Server Express.

I need a user to be able to schedule a task to run, say every second week starting from a particular date. eg: StartDate = 1/Jan/2013 12:00PM (Tuesday) and repeat every 14 days.

In the setup for the job, there is a StartTime (datetime), IntervalUnit (second, minute, hour, day, week, year) and RepeatsEvery (the number of intervals to fire after the start date).

eg: a setup of StartDate = “1/JAN/2013 12:00PM” and IntervalUnit = “DAY” and RepeatsEvery= 14, would fire the job every 2nd Tuesday at 12:00PM. If the StartDate is already passed, I need the job to fire on the next start date, eg: If I started the service today (18/JAN/2013), the next startdate would be 29/JAN/2013 12:00PM

I can’t figure out how to make this work in Quartz, using the Calendar Trigger. Is this something that is built in to Quartz or do I need to calculate a new StartTime on startup?

Assuming I have to calculate a new StartTime, is there any built in function or neat shortcut for this, or do I need a function similar to this for each IntervalUnit:

'Days
Dim diff As Integer
diff = Now.Subtract(.StartTime).TotalDays
Dim offset As Integer
offset = .RepeatsEvery - (diff Mod .RepeatsEvery)
offset = Now.AddDays(offset).Subtract(.StartTime).TotalDays 'Get the days from Start t preserve time of day
Start = .StartTime.AddDays(offset)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:52:20+00:00Added an answer on June 17, 2026 at 11:52 am

    You can create a trigger and then call trigger.GetFireTimeAfter(DateTime.Now) to calculate the new start date and then build and new trigger with the new StartDate.

    The following is C#, but hopefully gives you the idea

    var trigger = TriggerBuilder.Create()
                       .StartAt( new DateTimeOffset(new DateTime(2013,1,1)))
                       .WithSimpleSchedule(x=>x.RepeatForever()
                                              .WithInterval(new TimeSpan(14,0,0,0)))
                        .Build();                
    
    
    var newStartingPoint = trigger.GetFireTimeAfter(DateTime.Now);
    
    if (newStartingPoint.HasValue)  
    { 
         trigger = ((ISimpleTrigger) trigger).GetTriggerBuilder()
                                            .StartAt(newStartingPoint.Value)
                                            .Build();    
    }
    

    .GetTriggerBuilder() isn’t available on ITrigger, which is why you have to cast the trigger to ISimpleTrigger, but the same principle works with other triggers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to use Quartz plugin in Grails and want to run simple
new on ruby and using windows xp and rails 3, i want to send
I am using quartz 2d to draw a pie chart. I use layer to
This is probably a simple question, but I am pretty new to using Quartz.NET,
I want to use quartz in my small and simple web application. (Quartz 2.1.6
I have a windows service calling quartz.net as follows: ISchedulerFactory schedFact = new StdSchedulerFactory();
When I use QuartzHelper.getScheduler().checkExists(new JobKey(name,group_name)); to look after a job in scheduler - quartz
I'm using Quartz.NET scheduler as a stand-alone windows service while from an ASP.NET app
I'm using Quartz to write a simple server monitor in Java: public class ServerMonitorJob
New to Quartz and I am curious on the drawing speeds of simple shapes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.