Soenneker.Cron.Builder
4.0.359
Prefix Reserved
dotnet add package Soenneker.Cron.Builder --version 4.0.359
NuGet\Install-Package Soenneker.Cron.Builder -Version 4.0.359
<PackageReference Include="Soenneker.Cron.Builder" Version="4.0.359" />
<PackageVersion Include="Soenneker.Cron.Builder" Version="4.0.359" />
<PackageReference Include="Soenneker.Cron.Builder" />
paket add Soenneker.Cron.Builder --version 4.0.359
#r "nuget: Soenneker.Cron.Builder, 4.0.359"
#:package Soenneker.Cron.Builder@4.0.359
#addin nuget:?package=Soenneker.Cron.Builder&version=4.0.359
#tool nuget:?package=Soenneker.Cron.Builder&version=4.0.359
Soenneker.Cron.Builder
A mutable fluent builder for five-field cron expressions, with optional leading seconds for six-field schedulers.
Installation
dotnet add package Soenneker.Cron.Builder
Common schedules
Construct a new builder for each expression; no dependency-injection registration is required.
using Soenneker.Cron.Builder;
using Soenneker.Enums.DayOfWeek;
string everyFiveMinutes = new CronBuilder()
.WithMinuteInterval(5)
.Build();
// */5 * * * *
string weekdayMorning = new CronBuilder()
.Daily(hour: 9, minute: 30)
.Weekdays()
.Build();
// 30 9 * * MON-FRI
string mondayAtNoon = new CronBuilder()
.Weekly(DayOfWeekType.Monday, hour: 12)
.Build();
// 0 12 * * MON
string firstOfMonth = new CronBuilder()
.Monthly(dayOfMonth: 1, hour: 2, minute: 15)
.Build();
// 15 2 1 * *
ToString() returns the same value as Build().
Field order and defaults
Without WithSeconds, output uses the conventional order:
minute hour day-of-month month day-of-week
The untouched builder produces 0 * * * *, which means the top of every hour. Minutely() changes the minute field to *; Hourly() sets minute to 0 and hour to *.
Calling WithSeconds adds a leading seconds field:
string expression = new CronBuilder()
.WithSeconds(30)
.Minutely()
.Build();
// 30 * * * * *
Six-field cron dialects are not universal. Confirm that the target scheduler interprets the first field as seconds before using this form.
Composition rules
Builder calls update individual fields; they do not reset unrelated fields. This allows combinations such as Daily(...).Weekdays(), but reusing a builder also retains earlier month or day restrictions. Create a new builder when starting a different schedule.
Numeric ranges are checked for seconds, minutes, hours, day of month, month, and interval methods. Build() rejects a fixed day of month combined with any day-of-week restriction because that combination has scheduler-dependent semantics.
OnDayOfWeek(string) uppercases and emits the supplied token unchanged. Use it only for syntax supported by the target scheduler; the builder does not validate raw expressions.
The builder only formats expressions. It does not evaluate schedules, apply a time zone, account for daylight-saving transitions, or register jobs with a scheduler. Instances are mutable and should not be shared across concurrent expression construction.
| 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.796)
- Soenneker.Extensions.String (>= 4.0.799)
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.359 | 101 | 10/15/2026 |
| 4.0.358 | 71 | 10/14/2026 |
| 4.0.357 | 61 | 10/14/2026 |
| 4.0.355 | 62 | 10/14/2026 |
| 4.0.354 | 73 | 10/14/2026 |
| 4.0.353 | 86 | 10/14/2026 |
| 4.0.348 | 83 | 10/12/2026 |
| 4.0.346 | 79 | 10/12/2026 |
| 4.0.345 | 89 | 10/11/2026 |
| 4.0.344 | 85 | 10/11/2026 |
| 4.0.343 | 163 | 9/30/2026 |
| 4.0.342 | 96 | 9/30/2026 |
| 4.0.341 | 104 | 9/25/2026 |
| 4.0.340 | 96 | 9/25/2026 |
| 4.0.339 | 90 | 9/24/2026 |
| 4.0.338 | 89 | 9/24/2026 |
| 4.0.337 | 165 | 9/16/2026 |
| 4.0.336 | 106 | 9/16/2026 |
| 4.0.335 | 106 | 9/16/2026 |
| 4.0.334 | 104 | 9/15/2026 |
Updated Multiple NuGet packages