AFTimeZone.ToLocalTime Method (DateTime)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Returns the local time that corresponds to a specified time.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public override DateTime ToLocalTime( DateTime time )
Public Overrides Function ToLocalTime ( time As DateTime ) As DateTime Dim instance As AFTimeZone Dim time As DateTime Dim returnValue As DateTime returnValue = instance.ToLocalTime(time)
public: virtual DateTime ToLocalTime( DateTime time ) override
abstract ToLocalTime : time : DateTime -> DateTime override ToLocalTime : time : DateTime -> DateTime
Parameters
- time
- Type: SystemDateTime
A time to be converted. If a local time is specified, it is first converted to a UTC time using the current computer's time zone.
Return Value
Type: DateTimeReturns a DateTime instance whose value is the local time that corresponds to the specified time.
Remarks
Coordinated Universal Time (UTC) is sometimes referred to colloquially as
Greenwich Mean Time (GMT). Local time is the date and time on the computer you
are using. Offset is the difference between local time and UTC. That is:
local time = UTC + offset.
Version Information
AFSDK
See Also
Reference
TimeZoneInfo.ConvertTimeFromUtc