DH.NHoliday
4.25.2026.916-beta0414
.NET 11.0
This package targets .NET 11.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.5
This package targets .NET Framework 4.5. The package is compatible with this framework or higher.
This is a prerelease version of DH.NHoliday.
dotnet add package DH.NHoliday --version 4.25.2026.916-beta0414
NuGet\Install-Package DH.NHoliday -Version 4.25.2026.916-beta0414
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DH.NHoliday" Version="4.25.2026.916-beta0414" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DH.NHoliday" Version="4.25.2026.916-beta0414" />
<PackageReference Include="DH.NHoliday" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DH.NHoliday --version 4.25.2026.916-beta0414
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DH.NHoliday, 4.25.2026.916-beta0414"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DH.NHoliday@4.25.2026.916-beta0414
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DH.NHoliday&version=4.25.2026.916-beta0414&prerelease
#tool nuget:?package=DH.NHoliday&version=4.25.2026.916-beta0414&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DH.NHoliday - 中国假期识别库
中国假期识别库,内置假期调休数据库,每年维护更新,支持自动识别农历节假日。
包名 DH.NHoliday,命名空间保持 NewLife.Holiday,同步自 NewLife.Holiday。支持 net45 / net461 / netstandard2.0 / netstandard2.1 / net11.0。
使用方法
从 NuGet 引用 DH.NHoliday,代码中引入命名空间 NewLife.Holiday 即可使用 DateTime 扩展方法 IsChinaHoliday。
using NewLife.Holiday;
// var dt = DateTime.Now;
var dt = "2022-09-10".ToDateTime();
var rs = dt.IsChinaHoliday();
广西三月三
从 NuGet 引用 DH.NHoliday,代码中引入命名空间 NewLife.Holiday 即可使用 DateTime 扩展方法 IsGuangxiHoliday。
using NewLife.Holiday;
// var dt = DateTime.Now;
var dt = "2022-04-02".ToDateTime();
var rs = dt.IsGuangxiHoliday();
农历与节气
Lunar.FromDateTime(dt)公历转农历,提供生肖Zodiac、YearGanzhi干支纪年、ToString()中文农历字符串lunar.GetNearestSolarTerm()查询最近 24 节气,节气时间精确到时分秒,DaysTo天数差可含小数,需要精确判断日期时使用TermTime.Date
using NewLife.Holiday;
var lunar = Lunar.FromDateTime(DateTime.Now);
var term = lunar.GetNearestSolarTerm();
数据维护
- 全国假期调休数据:
DH.NHoliday/China/*.csv - 广西假期数据:
DH.NHoliday/Guangxi/*.csv - 数据以嵌入式资源打包进程序集,每年根据国务院办公厅节假日安排更新
| 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 was computed. 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 was computed. 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. net11.0 is compatible. |
| .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 is compatible. |
| .NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DH.NHoliday:
| Package | Downloads |
|---|---|
|
Pek.ChatAI
集对话前端、统一 AI 网关、Agent 平台于一身的完整 AI 应用。支持多轮对话、流式输出、函数调用、图像生成、会话管理与使用量统计 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.25.2026.916-beta0414 | 58 | 9/16/2026 |
| 4.25.2026.916-beta0109 | 85 | 9/16/2026 |
中国假期识别库,内置假期调休数据库,每年维护更新,支持自动识别农历节假日