TimeZoneInfo.GetAmbiguousTimeOffsets Method (DateTimeOffset)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns information about the possible dates and times that an ambiguous date and time can be mapped to.

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

Syntax

'Declaration
Public Function GetAmbiguousTimeOffsets ( _
    dateTimeOffset As DateTimeOffset _
) As TimeSpan()
public TimeSpan[] GetAmbiguousTimeOffsets(
    DateTimeOffset dateTimeOffset
)

Parameters

Return Value

Type: array<System.TimeSpan[]
An array of TimeSpan objects that represents possible Coordinated Universal Time (UTC) offsets that a particular date and time can be mapped to.

Exceptions

Exception Condition
ArgumentException

dateTime is not an ambiguous time.

Remarks

The precise behavior of this method depends on the relationship between the Offset property of the dateTimeOffset parameter and the TimeZoneInfo object. If the value of the Offset property corresponds to the current time zone's possible offsets from Coordinated Universal Time (UTC) for that date and time, the method returns the possible offsets. Otherwise, it converts dateTime to the time in the current time zone, and then returns the possible offsets of that date and time.

The order of TimeSpan objects in the array returned by this method is undefined. However, you can determine which element represents an offset from the time zone's standard time by comparing its value with the time zone's BaseUtcOffset property.

Version Notes

XNA Framework

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.