C# TimeZoneInfo SupportsDaylightSavingTime

Description

TimeZoneInfo SupportsDaylightSavingTime gets a value indicating whether the time zone has any daylight saving time rules.

Syntax

TimeZoneInfo.SupportsDaylightSavingTime has the following syntax.


public bool SupportsDaylightSavingTime { get; }

Example

The following example retrieves a collection of all time zones that are available on a local system and displays the names of those that do not support daylight saving time.


using  System.Collections.ObjectModel;
using System;// w w w  .  j a va2 s  .  c  om
public class MainClass{
  public static void Main(String[] argv){  
    ReadOnlyCollection<TimeZoneInfo> zones = TimeZoneInfo.GetSystemTimeZones();
    foreach(TimeZoneInfo zone in zones)
    {
       if (! zone.SupportsDaylightSavingTime)
          Console.WriteLine(zone.DisplayName);
    }
  }
}
    

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version