How to Check if Time Zone is British Summer Time in C#?

In this post, let’s have a look at a simple tip to find out if the current time zone is a British Summer Time (BST) or not in C#.

How to Check if Time Zone is British Summer Time in C#?

First get the TimeZoneInfo object and then use the use the function TimeZoneInfo.IsDaylightSavingTime Method to check if it is currently Daylight saving for your Timezone.

Usually, the Day Light Savings should be false for a Greenwich Standard Time for a British Summer Time Zone.

using System;

public class DeveloperPublish
{
    public static void Main() {

        var info = TimeZoneInfo.FindSystemTimeZoneById("Greenwich Standard Time");
        DateTimeOffset localServerTime = DateTimeOffset.Now;
        bool isDaylightSaving = info.IsDaylightSavingTime(localServerTime);
        Console.WriteLine("Day Light Savings :" + isDaylightSaving);
        Console.ReadLine();
    }
}