Freigeben über


TimeZoneInfo.IsDaylightSavingTime Method (DateTimeOffset)

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

Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current TimeZoneInfo object.

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

Syntax

'Declaration
Public Function IsDaylightSavingTime ( _
    dateTimeOffset As DateTimeOffset _
) As Boolean
public bool IsDaylightSavingTime(
    DateTimeOffset dateTimeOffset
)

Parameters

Return Value

Type: System.Boolean
true if the dateTimeOffset parameter is a daylight saving time; otherwise, false.

Remarks

The return value of TimeZoneInfo.IsDaylightSavingTime is affected by the relationship between the time zone represented by the TimeZoneInfo object and the Offset property of the dateTimeOffset parameter. If dateTimeOffset does not correspond to the current time zone's offset from Coordinated Universal Time (UTC), the method converts that time to the time in the current time zone. It then determines whether that date and time is a daylight saving time.

If the time zone represented by the TimeZoneInfo object does not support daylight saving time, the method always returns false.

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.