-
|
How would I set up a task to run every 15 minutes, between 6am and 11pm, Monday - Friday, indefinitely? Is that even possible? |
Beta Was this translation helpful? Give feedback.
Answered by
dahall
Oct 21, 2021
Replies: 2 comments 1 reply
-
|
I think this trigger does what you need: WeeklyTrigger wTrigger = new WeeklyTrigger();
// Start the trigger at 6:00 a.m. local time
wTrigger.StartBoundary = DateTime.Today + TimeSpan.FromHours(6);
// Sets to run on weekdays
wTrigger.DaysOfWeek = DaysOfTheWeek.Monday | DaysOfTheWeek.Tuesday | DaysOfTheWeek.Wednesday | DaysOfTheWeek.Thursday | DaysOfTheWeek.Friday;
// Run it every week
wTrigger.WeeksInterval = 1;
// Repeat every 15 minutes for 17 consecutive hours (6am-11pm == 17 hours)
wTrigger.SetRepetition(TimeSpan.FromMinutes(15), TimeSpan.FromHours(17), false); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dahall
-
|
Yes. Omit any reference to the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this trigger does what you need: