Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

Cron Expression Explainer

Ready
Runs in your browser. Nothing you paste is uploaded unless you share it.

Explain a cron expression in plain English or build one field by field, and see the next run times in any time zone

Paste a cron expression to read it in plain English and see exactly when it runs next, in your time zone or your server’s. Or switch to Build and make one field by field.

How to use it

  1. Type a cron expression (5 fields, 6 with seconds first, Quartz’s 7 with a year, or an EventBridge cron(...)) or pick a preset. Read as: Any cron tells the kinds apart; pick Quartz when 1 means Sunday.
  2. Read the sentence and the field-by-field breakdown. To make or change a schedule without writing cron, choose Build: each field gets a row, and the expression follows.
  3. Pick the server’s time zone to see the next 10 runs as it will see them.
  4. Read what deserves a second look, and copy the same schedule for Linux cron, Kubernetes, GitHub Actions, Quartz, Spring, EventBridge or a systemd timer.

Examples

Business hours, every 15 minutes

Input
*/15 9-17 * * 1-5
Result
Every 15 minutes, between 09:00 and 17:59, Monday through Friday

Macro

Input
@weekly
Result
0 0 * * 0 → At 00:00, only on Sunday

Cron syntax

Five fields, separated by spaces: minute, hour, day of month, month, day of week.

SymbolMeaningExample
*Every value* in hour = every hour
,List1,15 = the 1st and the 15th
-Range1-5 in day of week = Monday to Friday
/Step*/10 in minute = every 10 minutes
?No value: the other day field decides (Quartz, EventBridge; Spring reads it as *)0 0 12 ? * MON = noon on Mondays
L, #Last, nth (Quartz, Spring, EventBridge)5#3 = third Friday
W, LW, L-nWeekday nearest a day, last weekday, n days before the last (Quartz, Spring, EventBridge)15W = the weekday nearest the 15th
┌──────── minute (0–59)
│ ┌────── hour (0–23)
│ │ ┌──── day of month (1–31)
│ │ │ ┌── month (1–12)
│ │ │ │ ┌ day of week (0–7, Sunday = 0 or 7)
* * * * *

Quartz, Spring, EventBridge and the others

The same five fields don’t mean the same thing everywhere. Quartz and AWS EventBridge count the day of week from 1 = Sunday, so 0 0 12 ? * 2 is Monday there and Tuesday in Linux cron; they need ? in one of the two day fields, and add a year: Quartz as an optional 7th field, EventBridge always, after the day of week, with no seconds. Spring’s scheduler takes six fields with seconds first and counts days as cron does (0 or 7 = Sunday).

Read as tells the page which one you wrote; Any cron decides from the fields: seven fields or a ? in the 4th or 6th is Quartz, cron(...) or a ? in the 3rd or 5th with a year last is EventBridge. Under the runs, the schedule is written for each scheduler, or the page says why one can’t hold it (no seconds, no year, no L or W, or both day fields set). A systemd timer’s OnCalendar line is checked with systemd-analyze calendar.

SchedulerFieldsSunday
Linux cron, Kubernetes, GitHub Actionsminute hour day month weekday0 or 7
Spring @Scheduledsecond minute hour day month weekday0 or 7
Quartzsecond minute hour day month weekday [year]1
AWS EventBridgecron(minute hour day month weekday year)1

Sources: Quartz: CronTrigger tutorial, AWS: cron expressions, GitHub Actions: schedule, systemd.time: calendar events

Worth a second look

A step starts over at the top of its field: */7 in minutes runs at :00, :07 … :56 and again at :00, four minutes later, and */2 in day of month runs on the 31st and again on the 1st. A day like 31 is skipped in months without it rather than moved to the last day. @daily and the other @ names are not in POSIX cron or EventBridge. GitHub Actions runs a schedule at most every 5 minutes, in UTC. The page says which of these apply to what you typed.

Build a schedule field by field

Build gives each field a row: every value, every N (from a start), a list of values, or a range; the day of the month also has its last day. Weekdays and months are buttons. As you change a row the expression above is rewritten, and the sentence and the next runs follow, so you can check the schedule before you copy it.

It works the other way too: type or paste an expression and the rows show it. Parts the rows don’t offer, like MON#2 (the second Monday) or 5L (the last Friday), stay in the text and are still explained.

Day of month and day of week together

When both day fields are restricted (e.g. 0 0 1 * 1), classic cron runs when either matches: on the 1st of the month and on every Monday. If you mean "Mondays that are the 1st", check the date inside the job instead. One exception: a field that starts with *, like */2, makes both fields count, as in Vixie cron and cronie, so 0 0 */2 * 1 runs on Mondays with an odd date. The sentence and the next runs here follow these rules.

Questions

Which time zone does cron use?
The time zone of the machine or service running it. GitHub Actions and AWS EventBridge rules use UTC; a Kubernetes CronJob without a timeZone uses its controller’s zone, often UTC. Pick the zone above to see the run times as the scheduler will.
How do I write a cron expression for every weekday at 9:00?
Choose Build, set Minute to "At these minutes" 0, Hour to "At these hours" 9, and Day of week to "Between" Mon and Fri. The expression is 0 9 * * 1-5; the preset "Weekdays at 9:00" gives the same.
Does it support seconds?
Yes. With 6 fields, the first one is seconds, as in Quartz, Spring and node-cron.
Why does 0 0 12 ? * 2 run on Monday here?
The ? makes it a Quartz expression, and Quartz counts the day of week from 1 = Sunday, so 2 is Monday. In Linux cron 2 is Tuesday. Pick Linux cron under Read as to read the numbers the cron way.
What happens during daylight saving changes?
In zones with DST, a run at a skipped time (e.g. 02:30 on the spring-forward night) may not happen, and one in the repeated hour may happen twice, depending on the scheduler. The next-run list shows the real times in the chosen zone.

Related tools