GetUtcOffset Method (DateTimeOffset)
Collapse the table of content
Expand the table of content

TimeZoneInfo.GetUtcOffset Method (DateTimeOffset)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public TimeSpan GetUtcOffset(
	DateTimeOffset dateTimeOffset
)

Parameters

dateTimeOffset
Type: System.DateTimeOffset
The date and time to determine the offset for.

Return Value

Type: System.TimeSpan
A TimeSpan object that indicates the time difference between Coordinated Universal Time (UTC) and the current time zone.

The returned time span includes any differences due to the application of adjustment rules to the current time zone. It differs from the BaseUtcOffset property, which returns the difference between Coordinated Universal Time (UTC) and the time zone's standard time and, therefore, does not take adjustment rules into account.

Version Notes

XNA Framework

 When this method is used in the XNA Framework, it throws a NotSupportedException exception.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft