The source code to determine given date and time is daylight saving time or not 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()
{
DateTime dateTime1;
TimeZoneInfo time_zone = TimeZoneInfo.Local;
dateTime1 = new DateTime(2020, 2, 10, 10, 10, 10);
if (time_zone.IsDaylightSavingTime(dateTime1))
Console.WriteLine("It is daylight saving time");
else
Console.WriteLine("It is not daylight saving time");
}
}
Output:
It is not daylight saving time
Press any key to continue . . .
Program:
The source code to determine given date and time is daylight saving time or not is given below. The given program is compiled and executed successfully.
Output: