AFTimeZone.GetUtcOffset Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Calculates the offset or difference between the time in this time zone and the
Coordinated Universal Time (UTC) for a particular date and time.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public override TimeSpan GetUtcOffset( DateTime time )
Public Overrides Function GetUtcOffset ( time As DateTime ) As TimeSpan Dim instance As AFTimeZone Dim time As DateTime Dim returnValue As TimeSpan returnValue = instance.GetUtcOffset(time)
public: virtual TimeSpan GetUtcOffset( DateTime time ) override
abstract GetUtcOffset : time : DateTime -> TimeSpan override GetUtcOffset : time : DateTime -> TimeSpan
Parameters
- time
- Type: SystemDateTime
The date and time to determine the offset for. If a UTC time is specified, then a TimeSpan of 0 ticks is returned.
Return Value
Type: TimeSpanThe UTC offset from 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. The returned time span includes any differences due to the application of adjustment rules to the current time zone.
| See TimeZoneInfo.GetUtcOffset for more information. |