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

AF SDK Reference

IAFTimePeriod.SetEndTime Method

  • Last UpdatedNov 18, 2025
  • 3 minute read
IAFTimePeriod.SetEndTime Method
Set the time that represents the time that the period ended.

Namespace:  OSIsoft.AF.Time
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

void SetEndTime(
	Object endTime
)
Sub SetEndTime ( 
	endTime As Object
)

Dim instance As IAFTimePeriod
Dim endTime As Object

instance.SetEndTime(endTime)
void SetEndTime(
	Object^ endTime
)
abstract SetEndTime : 
        endTime : Object -> unit 

Parameters

endTime
Type: SystemObject
The new end time for the period. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.

Remarks

When you change the value of the end time, the new value must always be later than the StartTime. If the EndTime property evaluates to AFTime.MaxValue, the period is considered still in progress and the end time is implied as the current time. Passing AFTime.MaxValue to this method sets the end time so the period is implied to be still in progress.

Setting the end time will not automatically capture attribute values. To capture values, you must call the CaptureValues method. If the attribute values are captured, then modifying the end time will update the cached values. If the end time is set to AFTime.MaxValue, then any captured values will be cleared.

Version Information

AFSDK


See Also

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