AFTimeSpan.GetIntervalTimes Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public IList<AFTime> GetIntervalTimes( AFTimeRange timeRange )
Public Function GetIntervalTimes ( timeRange As AFTimeRange ) As IList(Of AFTime) Dim instance As AFTimeSpan Dim timeRange As AFTimeRange Dim returnValue As IList(Of AFTime) returnValue = instance.GetIntervalTimes(timeRange)
public: IList<AFTime>^ GetIntervalTimes( AFTimeRange timeRange )
member GetIntervalTimes : timeRange : AFTimeRange -> IList<AFTime>
Parameters
- timeRange
- Type: OSIsoft.AF.TimeAFTimeRange
The AFTimeRange specifying the boundaries for the returned interval times.
Return Value
Type: IListAFTimeReturns the interval times within the specified timeRange.
Exceptions
| Exception | Condition |
|---|---|
| InvalidOperationException | When this time span is Zero. |
Remarks
This method will calculate interval times that are within the specified timeRange. The sign of the current AFTimeSpan determines which end of the timeRange is used to start calculating interval times. A positive span will start the calculation beginning with the earlier time of the timeRange. A negative span (see IsNegative) will start the calculation beginning with the latest time of the timeRange. The returned times will be in increasing order when the StartTime is less than the EndTime. Otherwise the returned times will be in decreasing order.
The following table illustrates the interaction between timeRange and this time span.
| Time Range | Time Span | Timestamps returned |
|---|---|---|
| Ascending (Y to T) | Positive (5h) | Y, Y+5h, Y+10h, Y+15h, Y+20h |
| Descending (T to Y) | Positive (5h) | Y+20h, Y+15h, Y+10h, Y+5h, Y |
| Ascending (Y to T) | Negative (-5h) | T-20h, T-15h, T-10h, T-5h, T |
| Descending (T to Y) | Negative (-5h) | T, T-5h, T-10h, T-15h, T-20h |