How do I determine a public holiday in Sql server?

前端 未结 24 1896
慢半拍i
慢半拍i 2020-12-05 14:40

I have an application written in c# that cannot run on a public holiday or a weekend. I\'ve looked around a bit and haven\'t found anywhere (official) that provides all the

24条回答
  •  醉酒成梦
    2020-12-05 15:13

    You can user the Nager.Date library for calculate public holidays. https://github.com/nager/Nager.Date

    Nuget

    PM> install-package Nager.Date
    

    Example:

    var publicHolidays = DateSystem.GetPublicHoliday(CountryCode.GB, 2017);
    foreach (var publicHoliday in publicHolidays)
    {
        var name = publicHoliday.LocalName;
    }
    

提交回复
热议问题