AFTimeRange.AdjustForSyncTime Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Adjust the time range so that the start time and end time are in sync with the syncTime.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void AdjustForSyncTime( AFTimeSpan interval, AFTime syncTime, AFBoundaryType boundaryType )
Public Sub AdjustForSyncTime ( interval As AFTimeSpan, syncTime As AFTime, boundaryType As AFBoundaryType ) Dim instance As AFTimeRange Dim interval As AFTimeSpan Dim syncTime As AFTime Dim boundaryType As AFBoundaryType instance.AdjustForSyncTime(interval, syncTime, boundaryType)
public: void AdjustForSyncTime( AFTimeSpan interval, AFTime syncTime, AFBoundaryType boundaryType )
member AdjustForSyncTime : interval : AFTimeSpan * syncTime : AFTime * boundaryType : AFBoundaryType -> unit
Parameters
- interval
- Type: OSIsoft.AF.TimeAFTimeSpan
Interval used to calculate offset from syncTime. - syncTime
- Type: OSIsoft.AF.TimeAFTime
Timestamp at which to calculate even multiplier of intervals to provide new start time and end time. - boundaryType
- Type: OSIsoft.AF.DataAFBoundaryType
Boundary type to describe what to do if interval does not divide time range evenly and can affect both start time and end time.
Remarks
This is a utility method which adjusts the time range such that the start time and end time are at an even
multiplier of the interval from the provided syncTime. This method
was designed to be used in conjunction with data access methods (i.e. InterpolatedValues, Summaries, etc.).