AFVersion.SetObsoleteDate Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Set the obsolete date for this version of the owning object.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void SetObsoleteDate( Object obsoleteDate )
Public Sub SetObsoleteDate ( obsoleteDate As Object ) Dim instance As AFVersion Dim obsoleteDate As Object instance.SetObsoleteDate(obsoleteDate)
public: void SetObsoleteDate( Object^ obsoleteDate )
member SetObsoleteDate : obsoleteDate : Object -> unit
Parameters
- obsoleteDate
- Type: SystemObject
The date that the owning object became obsolete. The obsoleteDate cannot be before or equal to the EffectiveDate. Passing AFTime.MaxValue will remove the obsolete date from the object so that it is no longer considered obsolete. 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 AFTime.Now.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | This exception is thrown when the new obsoleteDate is less than or equal to the current EffectiveDate. |
Remarks
This method is used to set, modify, or remove the ObsoleteDate for this version of the owning object. Any changes for the current version of the object will be saved to the server after the obsolete date is changed.
Use the PISystem.Supports method to check if the PISystem supports the Versioning feature.
| Changing the ObsoleteDate may cause the current object to become invalid because it no longer exists at the current query date. |