![]() |
VOOZH | about |
dotnet add package Frank.CronJobs.Cron --version 3.0.0
NuGet\Install-Package Frank.CronJobs.Cron -Version 3.0.0
<PackageReference Include="Frank.CronJobs.Cron" Version="3.0.0" />
<PackageVersion Include="Frank.CronJobs.Cron" Version="3.0.0" />Directory.Packages.props
<PackageReference Include="Frank.CronJobs.Cron" />Project file
paket add Frank.CronJobs.Cron --version 3.0.0
#r "nuget: Frank.CronJobs.Cron, 3.0.0"
#:package Frank.CronJobs.Cron@3.0.0
#addin nuget:?package=Frank.CronJobs.Cron&version=3.0.0Install as a Cake Addin
#tool nuget:?package=Frank.CronJobs.Cron&version=3.0.0Install as a Cake Tool
Frank.CronJobs.Cron is a .NET library that provides cron expression parsing and scheduling capabilities. Its meant as an internal dependency for Frank.CronJobs, but works just fine as a CronParser
Parse and validate cron expression
string expression = "0 15 10 * * ?";
CronExpression cron = new CronExpression(expression);
bool isValid = cron.IsValid;
Calculate next occurrence
string expression = "0 15 10 * * ?";
DateTime next = CronExpression.GetNextOccurrence(expression);
Check if cron is due
string expression = "0 15 10 * * *";
DateTime dateTime = new DateTime(2023, 2, 15, 11, 0, 0);
bool isDue = CronExpression.IsDue(expression, dateTime); // true
Use helper methods
// Get next occurrence from current time
DateTime next = CronHelper.GetNextOccurrence(expression);
// Get time until next occurrence
TimeSpan timeToNext = CronHelper.GetTimeUntilNextOccurrence(expression);
// Check if due
bool isDue = CronHelper.IsDue(expression);
Use common cron expressions
string everySecond = PredefinedCronExpressions.EverySecond;
string everyMinute = PredefinedCronExpressions.EveryMinute;
string everyHour = PredefinedCronExpressions.EveryHour;
string everyDay = PredefinedCronExpressions.EveryDay;
string everyWeek = PredefinedCronExpressions.EveryWeek;
string everyMonth = PredefinedCronExpressions.EveryMonth;
string everyYear = PredefinedCronExpressions.EveryYear;
string everyYearOnChristmasEve = PredefinedCronExpressions.EveryYearOn.ChristmasEve;
Install the NuGet package directly from the package manager console:
PM> Install-Package Frank.CronJobs.Cron
Frank.CronJobs.Cron is licensed under the .
Contributions, except for actual bug fixes, are not welcome at this time. This is an internal dependency for Frank.CronJobs, and though it is a standalone library, it is not meant to be developed as such. If you have a bug fix, please submit a pull with a test that demonstrates the bug and the fix.
This library is based on CronQuery, which I am a contributor to. This is built on that code to change it in a few ways to better suit my needs for Frank.CronJobs, and make it a standalone library so the lightweight cron parsing can be used in other projects as well with no dependencies.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Frank.CronJobs.Cron:
| Package | Downloads |
|---|---|
|
Frank.CronJobs
Frank.CronJobs is a library for running cron jobs in .NET Core applications. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 260 | 7/8/2025 |
| 2.1.13-preview | 288 | 4/13/2025 |
| 2.1.12-preview | 257 | 4/13/2025 |
| 2.1.0 | 307 | 12/6/2024 |
| 2.0.9-preview | 206 | 7/11/2024 |
| 2.0.8-preview | 196 | 6/24/2024 |
| 2.0.0 | 356 | 2/3/2024 |
| 1.1.7-preview | 221 | 2/3/2024 |
| 1.1.6-preview | 229 | 1/29/2024 |
| 1.1.5-preview | 229 | 1/24/2024 |
| 1.1.0 | 259 | 1/21/2024 |
| 1.0.4-preview | 203 | 1/21/2024 |