When creating recurring schedules with intra-day parts, StartTime and EndTime define the execution window.
Despite the confusing names, StartTime and EndTime have nothing to do with StartDate and EndDate for a schedule. StartTime and EndTime define the active window for a schedule in a day (in other words, working hours for the schedule).
For example, in the image below, I am creating a weekly recurring schedule (on Sunday) that is executed every hour the whole day (from midnight to midnight).
There are interesting side effects of the way this “active window” is implemented.
For example, I want to create a schedule that triggers every hour of every day EXCEPT of work hours (from 8AM to 4PM). How do I do that?
The solution is to create a schedule that STARTS AT 4PM and ENDS AT 8AM. So the start time is AFTER end time! This works to create my desired schedule, except on the end date. If I want the last day the job is executed to be Feb 24th, the execution will actually end at 7AM on Feb 25th.
What happens is that we will execute the job from START TIME to END TIME, ignoring the date (this will take us through midnight). We will recheck the date only AFTER end time has passed.
There are workarounds if this behavior is not what you want. If you want a schedule with a “gap” in the middle of the day (like the one above), you can create 2 schedules, one for the first part of the day (from midnight to 7AM) and the other one for afternoon (from 4PM to midnight).
A good way to understand how StartTime and EndTime work is to think of a clock with a 24 hour face (for example, see the timer below). There is no “before” or “after” start time. We only have “inside” or “outside” the active window.
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified athttp://www.microsoft.com/info/cpyright.htm