Nager.Date
2.17.0
Prefix Reserved
dotnet add package Nager.Date --version 2.17.0
NuGet\Install-Package Nager.Date -Version 2.17.0
<PackageReference Include="Nager.Date" Version="2.17.0" />
<PackageVersion Include="Nager.Date" Version="2.17.0" />
<PackageReference Include="Nager.Date" />
paket add Nager.Date --version 2.17.0
#r "nuget: Nager.Date, 2.17.0"
#:package Nager.Date@2.17.0
#addin nuget:?package=Nager.Date&version=2.17.0
#tool nuget:?package=Nager.Date&version=2.17.0
Nager.Date
Nager.Date is a comprehensive .NET library for querying public and federal holidays, supporting over 110 countries worldwide. It provides native and English translations and supports country subdivisions (federal states) according to ISO 3166-2 standards.
Supported Countries
You can see the full list of supported countries here
Features
- Query public, federal, bank, school, and optional holidays (availability may vary by country).
- Support for country subdivisions (federal states, provinces).
- Native and English translations for holiday names.
- Retrieve holidays by year or date range.
- Check if a specific date is a public holiday.
- Weekend detection for any country.
Getting Started
Set License Key
HolidaySystem.LicenseKey = "TheLicenseKey";
Check License
var licenseKey = "TheLicenseKey";
var licenseInfo = Nager.Date.License.LicenseHelper.CheckLicenseKey(licenseKey);
if (licenseInfo is null)
{
//license key invalid
return;
}
if (licenseInfo.ValidUntil < DateTime.Today)
{
//license key expired
return;
}
Get Holidays for a Year
var holidays = HolidaySystem.GetHolidays(2024, "DE");
foreach (var holiday in holidays)
{
Console.WriteLine($"{holiday.Date:yyyy-MM-dd} - {holiday.EnglishName}");
//holiday...
//holiday.Date -> The date
//holiday.ObservedDate -> The date on which the holiday is observed
//holiday.LocalName -> The local name
//holiday.EnglishName -> The english name
//holiday.NationalHoliday -> Is this holiday in every county (federal state)
//holiday.SubdivisionCodes -> Is the holiday only valid for a special county ISO-3166-2 - Federal states
//holiday.HolidayTypes -> Public, Bank, School, Authorities, Optional, Observance
}
Get Holidays for a Date Range
var startDate = new DateTime(2016, 5, 1);
var endDate = new DateTime(2024, 5, 31);
var holidays = HolidaySystem.GetHolidays(startDate, endDate, CountryCode.DE);
foreach (var holiday in holidays)
{
//holiday...
}
Check if a date is a public holiday
var date = new DateTime(2024, 1, 1);
if (HolidaySystem.IsPublicHoliday(date, CountryCode.DE))
{
Console.WriteLine("This date is a public holiday.");
}
Check if a Date is on a Weekend
var date = new DateTime(2024, 1, 1);
if (WeekendSystem.IsWeekend(date, CountryCode.DE))
{
Console.WriteLine("The date falls on a weekend.");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8.1
- Nager.LicenseSystem (>= 1.2.1)
-
.NETStandard 2.0
- Nager.LicenseSystem (>= 1.2.1)
-
net10.0
- Nager.LicenseSystem (>= 1.2.1)
-
net8.0
- Nager.LicenseSystem (>= 1.2.1)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Nager.Date:
| Package | Downloads |
|---|---|
|
YellowCanary.IntervalQL
Package Description |
|
|
DateTimeConversionExtensions
A library of extension mehods to help convert times between time zones, add business days to a date time etc. Hat tip no Nager Date for calculating holidays and weekends for adding business days. Date time conversions use .Net's System.TimeZoneInfo. |
|
|
Brazil.DateTime
Brazil DateTime extension (Timezone convert, holidays, business days) |
|
|
MoreDateTime
A package to simplify dealing with .NET DateTime, DateOnly and TimeOnly objects |
|
|
Lava
Lava is a small Blazor components library |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Nager.Date:
| Repository | Stars |
|---|---|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.17.0 | 535 | 3/9/2026 |
| 2.16.1 | 1,020 | 2/28/2026 |
| 2.16.0 | 1,395 | 2/18/2026 |
| 2.15.0 | 1,601 | 2/11/2026 |
| 2.14.1 | 10,167 | 1/15/2026 |
| 2.14.0 | 7,048 | 12/1/2025 |
| 2.13.0 | 8,134 | 11/12/2025 |
| 2.12.0 | 7,266 | 10/21/2025 |
| 2.11.1 | 18,276 | 10/13/2025 |
| 2.11.0 | 1,620 | 10/6/2025 |
| 2.10.3 | 1,738 | 9/25/2025 |
| 2.10.2 | 1,073 | 9/24/2025 |
| 2.10.1 | 2,084 | 9/19/2025 |
| 2.10.0 | 1,507 | 9/18/2025 |
| 2.9.2 | 2,298 | 9/12/2025 |
| 2.9.1 | 57,516 | 8/20/2025 |
| 2.9.0 | 49,944 | 6/11/2025 |
| 2.8.7 | 5,049 | 6/2/2025 |
| 2.8.6 | 9,447 | 5/27/2025 |
| 2.8.5 | 6,164 | 5/12/2025 |
A changelog is available at https://github.com/nager/Nager.Date/releases