AFTime Constructor (DateTime)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Initializes a new instance of the AFTime structure to the specified DateTime.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFTime( DateTime time )
Public Sub New ( time As DateTime ) Dim time As DateTime Dim instance As New AFTime(time)
public: AFTime( DateTime time )
new : time : DateTime -> AFTime
Parameters
- time
- Type: SystemDateTime
The DateTime to be represented. If the Kind is Unspecified the time is treated as Coordinated Universal Time (UTC).
Exceptions
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if the timestamp is between 1/1/1900 and 1/1/1970. |
Remarks
Values less than January 1, 1900 will automatically be converted to MinValue.
Values between January 1, 1900 and MinValue (January 1, 1970) will generate an
ArgumentOutOfRangeException.