Validation/Cron Parser

Cron Parser

Explain an expression and list next runs

Parsed as five-field cron. Next runs use the current time in this browser.
Expression — input
Try one
Breakdown
Next runs

A cron expression packs a recurring schedule into five fields: minute, hour, day of month, month and day of week. Each accepts a value, a list, a range, a step or an asterisk for any. It is terse and, once you know it, readable — but it is also easy to write something that looks right and fires at a completely different time.

The classic trap is that day-of-month and day-of-week are combined with OR rather than AND when both are restricted. An expression naming both the 1st and Monday runs on every 1st and every Monday, not on Mondays that fall on the 1st. Reading a schedule back in plain English and seeing its next run times is the reliable way to catch that.

How to use it

  1. Paste the expressionFive fields for standard cron; a six-field expression with leading seconds is used by Quartz and several schedulers, and is recognised here too.
  2. Read the descriptionThe plain-English translation is where a mistake becomes obvious — "at 0 minutes past every hour" reads very differently from "at midnight".
  3. Check the next run timesThe upcoming occurrences are the real test. If the gaps are not what you expect, the expression is wrong regardless of how it reads.

Frequently asked questions

What do the five fields mean?

In order: minute (0–59), hour (0–23), day of month (1–31), month (1–12) and day of week (0–7, where both 0 and 7 mean Sunday). An asterisk means every value, a slash introduces a step, a hyphen a range and a comma a list. So 0 */4 * * * is every four hours on the hour.

How do day-of-month and day-of-week interact?

This is the field everyone gets wrong. If both are restricted, cron runs when either matches, not both. "0 0 1 * MON" fires on the first of every month and on every Monday. To require a specific weekday within a date range you have to restrict one field and test the other inside the job itself.

What time zone does cron use?

The system or scheduler time zone, which is a frequent source of surprise when a server runs UTC and the team thinks in local time. Where daylight saving applies, a job scheduled in the skipped hour may not run at all, and one in the repeated hour may run twice. Scheduling in UTC avoids both.

How do I run something every 90 minutes?

You cannot, with one expression. Cron steps divide the field evenly, and 90 minutes does not divide into an hour or a day. The workarounds are two expressions covering alternating times, or a job that runs more often and decides for itself whether to act.

What do @daily and @reboot mean?

They are shorthand macros: @yearly, @monthly, @weekly, @daily and @hourly stand in for common expressions, so @daily is 0 0 * * *. @reboot is different in kind — it runs once when cron starts rather than on a schedule, and it is not supported by every implementation.

Related tools

Nothing left this tab. No request was made, no history was written. Validation · Cron Parser