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