AFTimeZone.ToLocalTime Method (AFTimeZone, DateTime)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Convert a DateTime to the specified AFTimeZone.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static DateTime ToLocalTime( AFTimeZone destination, DateTime time )
Public Shared Function ToLocalTime ( destination As AFTimeZone, time As DateTime ) As DateTime Dim destination As AFTimeZone Dim time As DateTime Dim returnValue As DateTime returnValue = AFTimeZone.ToLocalTime(destination, time)
public: static DateTime ToLocalTime( AFTimeZone^ destination, DateTime time )
static member ToLocalTime : destination : AFTimeZone * time : DateTime -> DateTime
Parameters
- destination
- Type: OSIsoft.AF.TimeAFTimeZone
The AFTimeZone of the returned time. - time
- Type: SystemDateTime
The DateTime to be converted to the local time of the destination time zone.
Return Value
Type: DateTimeReturns the time as a local time in the destination time zone.
Remarks
This method converts the time to the local time representation
of the specified destination time zone.
Version Information
AFSDK
See Also
Reference
TimeZoneInfo.ConvertTimeFromUtc