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.