@Tanuja Valluru Thanks for reaching out.
Please refer to previous discussion here.
<SNIP>
ScheduleStatus is a structure persisted to storage to aid in detection of past due schedule invocations. As the class xml doc says, Next is “the next schedule occurrence”. So on startup, if schedule monitoring is active, we’ll load the ScheduleStatus (code here) and use Next to determine how long to wait before the next invocation (Next - Now). Thus, when this duration expires, we’ll invoke the function and Next will equal Now.
So Next isn’t the next schedule time from the current invocation – it’s the value that was used to determine when to invoke the current invocation. The naming of the properties of ScheduleStatus are from the perspective of the scheduler, not from the perspective of the current invocation. This is by design, though I can appreciate why there may be some confusion.
If the goal is to determine the next expected invocation from the time of the current invocation, the schedule can be used as follows to determine that:
public static void CronJob([TimerTrigger("*/15 * * * * *")] TimerInfo timerInfo)
{
var schedule = timerInfo.Schedule as CronSchedule;
var next = schedule.GetNextOccurrence(DateTime.UtcNow);
. . .
}
</SNIP>