Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFTimeZone.GetUtcOffset Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFTimeZone.GetUtcOffset Method
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: TimeSpan
The 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.

Note Note
See TimeZoneInfo.GetUtcOffset for more information.

Version Information

AFSDK


See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in