Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFTimeRange.AdjustForSyncTime Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFTimeRange.AdjustForSyncTime Method
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.).

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in