AFTimeSpan.ToTimeSpan Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Returns the time span as a standard TimeSpan object.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public TimeSpan ToTimeSpan()
Public Function ToTimeSpan As TimeSpan Dim instance As AFTimeSpan Dim returnValue As TimeSpan returnValue = instance.ToTimeSpan()
public: TimeSpan ToTimeSpan()
member ToTimeSpan : unit -> TimeSpan
Return Value
Type: TimeSpanReturns the time span as a standard TimeSpan object.
Remarks
The span interval is returned as standard TimeSpan object.
Since there are a variable number of days in a year or month, an
AFTimeSpan defined using these interval values may return
unexpected results. A year interval is calculated as 365.25 days and a month
interval is calculated as 30 days.