Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IsDaylightSavingTime Method (DateTimeOffset)
Collapse the table of content
Expand the table of content

TimeZoneInfo.IsDaylightSavingTime Method (DateTimeOffset)

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)

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

Parameters

dateTimeOffset
Type: System.DateTimeOffset

A date and time value.

Return Value

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

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.

Notes to Callers

On Windows XP systems, this method applies only the current adjustment rule if the current instance is TimeZoneInfo.Local. As a result, the method may not accurately report whether dateTimeOffset is a daylight saving time 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.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

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

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft