Export (0) Print
Expand All

TimeZoneInfo::GetAmbiguousTimeOffsets Method (DateTimeOffset)

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)

public:
array<TimeSpan>^ GetAmbiguousTimeOffsets(
	DateTimeOffset dateTimeOffset
)

Parameters

dateTimeOffset
Type: System::DateTimeOffset

A date and time.

Return Value

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

ExceptionCondition
ArgumentException

dateTime is not an ambiguous time.

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. To map an ambiguous time to a time zone's standard time, see How to: Resolve Ambiguous Times.

Notes to Callers

On Windows XP systems, this method applies only the current adjustment rule when determining whether dateTimeOffset is ambiguous if the current instance is TimeZoneInfo::Local. As a result, the method may not accurately report ambiguous time offsets for periods before the current adjustment rule came into effect. For more information, see the Notes for Callers section in the Local property.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft