SPSchedule.NextOccurrence Method
Returns a random time in the period between the begin and end times specified by the schedule that occurs after the specified time.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Overridable Function NextOccurrence ( _
dt As DateTime _
) As DateTime
'Usage
Dim instance As SPSchedule
Dim dt As DateTime
Dim returnValue As DateTime
returnValue = instance.NextOccurrence(dt)
public virtual DateTime NextOccurrence(
DateTime dt
)
Parameters
dt
Type: System.DateTimeA System.DateTime structure that specifies the date and time after which the randomized time occurs.
Return Value
Type: System.DateTime
A System.DateTime value that represents the next occurrence.
Remarks
A custom class that is derived from the SPSchedule class must override this method.
Calling the NextOccurrence method for a job definition returns a random time and not the next time the job will run.