সিনট্যাক্স
public bool IsDaylightSavingTime ();
উদাহরণ
using System;
public class Demo {
public static void Main() {
DateTime d = new DateTime(2019, 10, 11, 7, 10, 40);
bool res = d.IsDaylightSavingTime();
if (res)
Console.WriteLine("TRUE: This instance of DateTime is within the daylight saving time range for the current time zone.");
else
Console.WriteLine("FALSE: This instance of DateTime is within the daylight saving time range for the current time zone.");
}
}
আউটপুট
FALSE: This instance of DateTime is within the daylight saving time range for the current time zone.
আরেকটি উদাহরণ (Now)
using System;
public class Demo {
public static void Main() {
DateTime d = DateTime.Now;
bool res = d.IsDaylightSavingTime();
if (res)
Console.WriteLine("TRUE: This instance of DateTime is within the daylight saving time range for the current time zone.");
else
Console.WriteLine("FALSE: This instance of DateTime is within the daylight saving time range for the current time zone.");
}
}
আউটপুট
FALSE: This instance of DateTime is within the daylight saving time range for the current time zone.