Cron expression parser

    Advertisement

    How does a cron expression work?

    Cron is a time-based job scheduler used in Unix-like operating systems. A cron expression defines when a scheduled task should run, using five space-separated fields: minute, hour, day of month, month, and day of week.

    The five fields, explained

    Reading left to right, the fields are: minute (0–59), hour (0–23), day of month (1–31), month (1–12, or jandec), and day of week (0–7, where both 0 and 7 mean Sunday, or sunsat). A job runs whenever the current time matches every field. So 0 9 * * 1-5 means "at minute 0 of hour 9, on any day of the month, in any month, on weekdays" — 9am every weekday.

    Special characters (*, /, -, ,)

    * means "every value" for that field. / sets a step, e.g. */15 in the minute field means every 15 minutes. - defines an inclusive range, e.g. 9-17 means 9 through 5pm. , lists specific values, e.g. 1,15 in the day-of-month field means the 1st and the 15th. These can be combined within a single field, e.g. 0,30 9-17 * * 1-5.

    Named aliases (@daily, @hourly, etc.)

    Some cron implementations accept shorthand aliases in place of the five fields: @yearly/@annually (0 0 1 1 *), @monthly (0 0 1 * *), @weekly (0 0 * * 0), @daily/@midnight (0 0 * * *), and @hourly (0 * * * *). This parser accepts and expands all of them.

    Building a schedule from presets

    Switch to Build mode to generate a valid expression without memorising the field order — pick a preset for each field and the correct cron string is assembled for you as you go.

    When day-of-month and day-of-week are both restricted

    If both the day-of-month and day-of-week fields are set to something other than *, cron treats them as an OR, not an AND — the job runs when either condition is true, not only when both are. For example 0 0 1 * 1 runs at midnight on the 1st of the month and on every Monday, not only on Mondays that happen to fall on the 1st. This tool follows that same convention when calculating next-run times.

    Limitations

    Next-run times are calculated entirely in your browser, using your device's local clock and, when Local is selected, your device's timezone — not a server. This tool doesn't support the non-standard sixths-field ("seconds") variant some schedulers use, and daylight-saving transitions in the Local timezone view follow your browser's own handling of clock changes rather than being independently verified.