Soenneker.Utils.CronExpressions
4.0.323
Prefix Reserved
dotnet add package Soenneker.Utils.CronExpressions --version 4.0.323
NuGet\Install-Package Soenneker.Utils.CronExpressions -Version 4.0.323
<PackageReference Include="Soenneker.Utils.CronExpressions" Version="4.0.323" />
<PackageVersion Include="Soenneker.Utils.CronExpressions" Version="4.0.323" />
<PackageReference Include="Soenneker.Utils.CronExpressions" />
paket add Soenneker.Utils.CronExpressions --version 4.0.323
#r "nuget: Soenneker.Utils.CronExpressions, 4.0.323"
#:package Soenneker.Utils.CronExpressions@4.0.323
#addin nuget:?package=Soenneker.Utils.CronExpressions&version=4.0.323
#tool nuget:?package=Soenneker.Utils.CronExpressions&version=4.0.323
Soenneker.Utils.CronExpressions
Static helpers for producing common five-field cron expressions.
Installation
dotnet add package Soenneker.Utils.CronExpressions
Usage
string everyFiveMinutes = CronExpressionUtil.EveryXMinutes(5); // */5 * * * *
string everySixHours = CronExpressionUtil.EveryXHours(6, minute: 15); // 15 */6 * * *
string daily = CronExpressionUtil.DailyAt(hour: 2, minute: 30); // 30 2 * * *
string weekly = CronExpressionUtil.WeeklyAt(DayOfWeekType.Monday, hour: 9); // 0 9 * * MON
string monthly = CronExpressionUtil.MonthlyAt(dayOfMonth: 1, hour: 8); // 0 8 1 * *
string weekdays = CronExpressionUtil.WeekdaysAt(hour: 7, minute: 45); // 45 7 * * MON-FRI
string weekends = CronExpressionUtil.WeekendsAt(hour: 10); // 0 10 * * SAT,SUN
The output order is minute hour day-of-month month day-of-week. These expressions do not include a seconds or year field. The scheduler consuming the expression determines its timezone and exact cron dialect, so verify that it accepts standard five-field syntax and named weekdays.
The pattern helpers validate minute, hour, interval, and day-of-month ranges. A monthly expression using day 29, 30, or 31 simply has no occurrence in months that lack that date.
Custom fields
Format() combines numeric minute/hour values with caller-supplied day, month, and weekday fields:
string firstQuarter = CronExpressionUtil.Format(
minute: 0,
hour: 6,
dom: "1",
month: "1,4,7,10",
dow: "*");
Format() performs formatting only; it does not validate any field. Use the pattern-specific methods when their validation and semantics fit the schedule.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Soenneker.Enums.DayOfWeek (>= 4.0.778)
- Soenneker.Extensions.String (>= 4.0.770)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.323 | 158 | 9/30/2026 |
| 4.0.322 | 87 | 9/30/2026 |
| 4.0.321 | 99 | 9/25/2026 |
| 4.0.320 | 96 | 9/25/2026 |
| 4.0.319 | 92 | 9/24/2026 |
| 4.0.318 | 84 | 9/24/2026 |
| 4.0.317 | 155 | 9/16/2026 |
| 4.0.316 | 94 | 9/16/2026 |
| 4.0.315 | 95 | 9/15/2026 |
| 4.0.314 | 92 | 9/13/2026 |
| 4.0.312 | 98 | 9/13/2026 |
| 4.0.311 | 97 | 9/12/2026 |
| 4.0.310 | 101 | 9/12/2026 |
| 4.0.306 | 101 | 9/9/2026 |
| 4.0.305 | 101 | 9/8/2026 |
| 4.0.304 | 113 | 9/8/2026 |
| 4.0.303 | 107 | 9/7/2026 |
| 4.0.301 | 103 | 9/7/2026 |
| 4.0.300 | 102 | 9/7/2026 |
| 4.0.299 | 108 | 9/5/2026 |
Updated Soenneker.Extensions.String to 4.0.770