Cron expression tester for .NET

Type an expression and pick the library that will read it. The next run times come from a port of that library's rules, checked against the library itself.

Fields in each format

LibraryFieldsDay of weekExtras
NCrontab (5)minute hour day month day-of-week0–6, 0 = Sunday, or SUN–SATlists, ranges, */n, a/n
NCrontab with seconds (Azure Functions)second minute hour day month day-of-week0–6, 0 = Sundayas above
Cronos (Hangfire)[second] minute hour day month day-of-week0–7, 0 and 7 = SundayL, L-n, nW, LW, 5L, 1#2, ?, @daily and other macros
Quartz.NETsecond minute hour day month day-of-week [year]1–7, 1 = Sunday, or SUN–SATL, L-n, nW, LW, 6L, 2#1, ?, year field

Hangfire Cron helpers

The strings Hangfire's Cron class returns (Hangfire.Core 1.8.25.0):

CallExpression
Cron.Minutely()* * * * *
Cron.Hourly()0 * * * *
Cron.Hourly(15)15 * * * *
Cron.Daily()0 0 * * *
Cron.Daily(9)0 9 * * *
Cron.Daily(9, 30)30 9 * * *
Cron.Weekly()0 0 * * 1
Cron.Weekly(DayOfWeek.Friday, 17)0 17 * * 5
Cron.Monthly()0 0 1 * *
Cron.Monthly(15)0 0 15 * *
Cron.Yearly()0 0 1 1 *
Cron.Never()0 0 31 2 *

Common schedules

Checked against NCrontab 3.4.0.0, Cronos, Quartz.NET 4.7.3.0 and Hangfire 1.8.25.0: every example and test expression gives the same next run times as the library.

Questions

What format does an Azure Functions timer trigger use?

NCrontab with six fields: {second} {minute} {hour} {day} {month} {day-of-week}. Pick “NCrontab with seconds” above. Microsoft’s timer trigger documentation says five-field expressions are supported too; pick “NCrontab (5 fields)” for those.

Why does “0 0 13 * 5” only run on Friday the 13th?

In NCrontab and in Cronos (Hangfire), a day of month and a day of week must both match, so the expression fires only when the 13th is a Friday. Quartz.NET fires when either matches. Checked against NCrontab 3.4.0.0, Cronos and Quartz.NET 4.7.3.0.

Is Sunday 0 or 7?

NCrontab accepts 0–6 only (7 is an error). Cronos accepts both 0 and 7. Quartz.NET numbers days 1–7 with 1 = Sunday, so MON is 2; using names (SUN, MON…) avoids the mix-up.

What does Hangfire’s Cron.Never() produce?

0 0 31 2 *: 31 February, which never exists, so the job only runs when triggered by hand.

What does “?” mean?

“No specific value”. Quartz.NET uses it in the day-of-month or day-of-week field; Cronos accepts it as “*”. NCrontab rejects it.

Which time zone are the run times in?

UTC, plus the same instants in your browser’s time zone. Azure Functions uses UTC unless the app setting WEBSITE_TIME_ZONE is set (Microsoft’s timer trigger documentation); Hangfire and Quartz.NET can be given a time zone too, which shifts the clock times.

More tools

Runs in your browser: nothing you paste is sent anywhere. Not affiliated with Microsoft, the .NET Foundation or the library authors.