I defined the following trigger for the job:
var postbagJobTrigger = (ICronTrigger) Trigger builder Crete () .indenti ("Kronjober", "Campaign"). Cronshedulable ("0 13 9 1/5 *? *") Start at (new date time (2014, 12, 3)). Endat (new date 2015, 3, 3)). Prioritize (1). Dam ();
What do I expect that the first time of my trigger should be date time (2014, 12, 3)
. But when I look at this job firing schedule, for the first time, there is a datetime (2014, 12, 6)
. And when I add the StartNow ()
condition, it will be the first time that the program that is now starting is date time (2014, 10, 31)
. How can I tell my trigger to run my StartAt ()
timeline for the first time?
This seems fine for me. The problem is in your cron expression this is the result of December:
8 Monday, December 1, 2014 9:13 AM 9 Saturday, December 6, 2014 9: Wednesday, December 13, 2014 9:13 AM Sunday, December 26, 2014 9:13 AM Sunday, December 26, 2014 9:13 AM Sunday, December 26, 2014 9:13 AM Wednesday, December 26, 2014 9:13 AM Wednesday, December 31, 2014 9 : 13 AM
<>
You have instructed quartz net to start counting on December 3.
You can check your expression.
It is not better to use
DateTime
. This is the definition forStartAt
:// // Summary: Determine whether triggers must start - can trigger or not // At this time - although based on the scheduled schedule for the trigger, despite the timing of the trigger, the trigger will not fire before this time // // parameter: // startTimeUtc: // the start time for the trigger / // Returns: // Updated Trigger Builder Public Trigger Builder Start T (Dettaimofset Starttaim UTC);
You should use the
date offset
. It can help you.Update:
Quartz.net uses your local unless you specify a different one.
If you want to see what time your trigger is using:
(Cronfragrir empolis trigger). Time zone
is a better way to use:
DateTime Offset DTNO = DateBuilder.Dateoff (10, 32, 30, 28, 10, 2014);
That's your local timezone.
If you are asking what you are asking for, you can do something like this:
Iitigrid trigger = trigger builder. (., 0, 0, 3, 12, 2014)) Startup 0, 3, 3, 2015)) // KornSetleal (00 0 1/5 *? *). With the calendar interface (F = & amp; F. Interlaval indented (5)) with priority (1). Builder ();
< / Pre>or
trigger trigger = trigger builder. (., "My group"). 0, 0, 3, 12, 2014). End (Debtbuilder Date (0 , 0, 3, 3, 2015)) // cronShedulable ("0 12 1/5 *? *"). Simplicable (F = & gt; F-Interval Inner (24 * 5). Repeater () With priority (1). Builder ();
If you set your schedule call
GetNextXFireTimes
This function is:Private Zero GetNextXFireTimes (Iittigar Trigger, Int Minnels) {var dt = trigger.GetNextFireTimeUtc (); for (int i = 0; i & lt ; (Calculation -1); i ++) {if (dt == null) {break;} console.lightline (dt.value.TolocalTime); dt = trigger.GetFireTimeAfter (dt);}}
This method is cron expression :
* * * * * - - - - - - | | | | | | | | + ----- The day of the week (0 - 6) (Sunday = 0). | | + ------- months (1 - 12). | + --------- Day of the month (1 - 31). + ----------- hours (0-23) + ------------- minutes (0 - 59)
Comments
Post a Comment