C#-এ DateTime.IsDaylightSavingTime() পদ্ধতিটি বর্তমান টাইম জোনের জন্য ডেলাইট সেভিং টাইম রেঞ্জের মধ্যে আছে কিনা তা নির্দেশ করতে ব্যবহার করা হয়৷
সিনট্যাক্স
নিচের সিনট্যাক্স −
public bool IsDaylightSavingTime ();
উদাহরণ
এখন DateTime.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.
উদাহরণ
এখন DateTime.IsDaylightSavingTime() পদ্ধতি প্রয়োগ করার জন্য আরেকটি উদাহরণ দেখা যাক -
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.