AFTime Constructor (Object, IFormatProvider)
- 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 value
representation of time using the specified culture-specific information and
formatting style.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFTime( Object time, IFormatProvider provider )
Public Sub New ( time As Object, provider As IFormatProvider ) Dim time As Object Dim provider As IFormatProvider Dim instance As New AFTime(time, provider)
public: AFTime( Object^ time, IFormatProvider^ provider )
new : time : Object * provider : IFormatProvider -> AFTime
Parameters
- time
- Type: SystemObject
Converts different types of objects, including PISDK.PITime objects, to AFTime. A will return an AFTime representing the current time. - provider
- Type: SystemIFormatProvider
An object that supplies culture-specific formatting information about the time string parameters. The AFTimeZoneFormatProvider can be used to provide the AFTimeZone to be used when parsing. The AFLocaleIndependentFormatProvider can be used when parsing PI SDK locale independent time strings.
If or an AFTimeZoneFormatProvider is specified with the Provider as , then CurrentCulture will be used first when parsing the time strings. If the parsing fails in this case, then a second attempt is made to parse using InvariantCulture.
Remarks
This constructor will convert the specified object to a new instance of an
AFTime using the specified culture-specific information. The .NET4 version
of this constructor will accept a PISDK.PITime as input. This is no longer
supported in .NET8