Q:

C# program for TimeZoneInfo.SupportsDaylightSavingTime Property

0

Syntax:

    bool TimeZoneInfo.SupportsDaylightSavingTime

Return value:

It returns a boolean value that denotes available time zones are daylight-saving time rules or not. If the time zone supports daylight time, then it returns true otherwise it returns false.

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

The source code to demonstrate the example for TimeZoneInfo.SupportsDaylightSavingTime Property is given below. The given program is compiled and executed successfully.

using System;
using System.Globalization;
using System.Collections.ObjectModel;

class TimeZoneInfoDemo
{
    //Entry point of Program
    static public void Main()
    {
        ReadOnlyCollection<TimeZoneInfo> timeZones;

        timeZones = TimeZoneInfo.GetSystemTimeZones();

        Console.WriteLine("Supported daylight saving time:");
        foreach (TimeZoneInfo timeZone in timeZones)
        {
            if (!timeZone.SupportsDaylightSavingTime)
                Console.WriteLine("\t"+timeZone.DisplayName);
        }
    }
}

Output:

Supported daylight saving time:
        (UTC-12:00) International Date Line West
        (UTC-11:00) Midway Island, Samoa
        (UTC-10:00) Hawaii
        (UTC-07:00) Arizona
        (UTC-06:00) Central America
        (UTC-06:00) Saskatchewan
        (UTC-05:00) Bogota, Lima, Quito
        (UTC-05:00) Indiana (East)
        (UTC-04:30) Caracas
        (UTC-04:00) Georgetown, La Paz, San Juan
        (UTC-03:00) Cayenne
        (UTC-01:00) Cape Verde Is.
        (UTC) Coordinated Universal Time
        (UTC) Monrovia, Reykjavik
        (UTC+01:00) West Central Africa
        (UTC+02:00) Harare, Pretoria
        (UTC+03:00) Kuwait, Riyadh
        (UTC+03:00) Nairobi
        (UTC+03:00) Tbilisi
        (UTC+04:00) Abu Dhabi, Muscat
        (UTC+04:30) Kabul
        (UTC+05:00) Tashkent
        (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
        (UTC+05:30) Sri Jayawardenepura
        (UTC+05:45) Kathmandu
        (UTC+06:00) Astana, Dhaka
        (UTC+06:30) Yangon (Rangoon)
        (UTC+07:00) Bangkok, Hanoi, Jakarta
        (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi
        (UTC+08:00) Kuala Lumpur, Singapore
        (UTC+08:00) Taipei
        (UTC+09:00) Osaka, Sapporo, Tokyo
        (UTC+09:00) Seoul
        (UTC+09:30) Darwin
        (UTC+10:00) Brisbane
        (UTC+10:00) Guam, Port Moresby
        (UTC+11:00) Magadan, Solomon Is., New Caledonia
        (UTC+12:00) Fiji, Marshall Is.
        (UTC+13:00) Nuku'alofa
Press any key to continue . . .

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now