# Cron Syntax Compared: Unix, Quartz, AWS, GitHub Actions

> Unix cron has five fields. Quartz adds seconds, AWS EventBridge adds a year, and each numbers weekdays differently. A field-by-field comparison.

- URL: https://generate.now/guides/cron-syntax-comparison
- Published by: Hyperdusk Ltd (https://hyperdusk.com)
- Published: 2026-11-11
- Last updated: 2026-11-11

## The short answer

Unix cron uses five fields: minute, hour, day of month, month and day of week. Quartz adds a seconds field at the start and an optional year at the end. AWS EventBridge uses six fields with the year last and no seconds. GitHub Actions uses the five-field form, in UTC by default. The dialects also number weekdays differently.

## Key differences

**Cron dialects side by side**

|   | Unix cron | Quartz | AWS EventBridge | GitHub Actions |
| --- | --- | --- | --- | --- |
| Number of fields | 5 | 6 or 7 | 6 | 5 |
| Field order | minute, hour, day of month, month, day of week | second, minute, hour, day of month, month, day of week, optional year | minute, hour, day of month, month, day of week, year | minute, hour, day of month, month, day of week |
| Seconds field | No | Yes, first | No | No |
| Year field | No | Optional, 1970-2099 | Required, 1970-2199 | No |
| Day-of-week numbers | 0-6 with 0 = Sunday; cronie also accepts 7 | 1-7 with 1 = Sunday | 1-7 with 1 = Sunday | 0-6 or SUN-SAT |
| Extra characters | None in POSIX; cronie adds / and ~ | / ? L W # | / ? L W # | / |
| Both day fields set | Runs when either matches | Not supported: one must be ? | Not allowed: one must be ? | POSIX syntax |
| Time zone | The system's; cronie has CRON_TZ | Not covered by the tutorial | UTC for rules; any IANA zone in EventBridge Scheduler | UTC by default |
| Shortest interval | 1 minute | 1 second | 1 minute | 5 minutes |

_Unix cron means the POSIX crontab format, with cronie, the implementation documented in the Linux crontab(5) manual page, where it differs._

## What are the five fields of a standard cron expression?

POSIX defines them as minute (0-59), hour (0-23), day of the month (1-31), month (1-12) and day of the week (0-6, with 0 as Sunday). Each field is an asterisk for every value, a number, a range such as `1-5`, or a comma-separated list.

That is all POSIX defines. Step values such as `*/5`, month and day names, and 7 as a second way to write Sunday are extensions. cronie supports all three, plus `~` for a random value in a range and nicknames such as `@daily` and `@reboot`. An expression that uses only numbers, ranges, lists and asterisks is the most portable.

**Common five-field cron expressions**

| Expression | Meaning |
| --- | --- |
| `*/5 * * * *` | Every 5 minutes |
| `0 * * * *` | Every hour |
| `0 */2 * * *` | On the hour, every 2 hours |
| `0 9 * * 1-5` | At 09:00, Monday through Friday |
| `0 9-17 * * 1-5` | Every hour, between 09:00 and 17:00, Monday through Friday |
| `0 0 * * 0` | At 00:00, only on Sunday |
| `0 0 1 * *` | At 00:00, on day 1 of the month |
| `30 4 1,15 * *` | At 04:30, on day 1 and 15 of the month |
| `0 0 1 1 *` | At 00:00, on day 1 of the month, only in January |
| `30 4 1,15 * 5` | At 04:30, on day 1 and 15 of the month, and on Friday |

_Meanings generated with the cronstrue library, version 3.14.0, in 24-hour format. The step values in the first and third rows are an extension that cronie, Quartz, AWS and GitHub Actions all accept._

## What happens when both day fields are set?

In Unix cron, the job runs when either one matches. POSIX states it, and the cronie manual gives the example in the last row of the table: `30 4 1,15 * 5` runs at 4:30 am on the 1st and 15th of each month, plus every Friday. It does not mean "the 1st and 15th, if a Friday".

Quartz and AWS avoid the question. Both add a `?` character meaning "no specific value", and both require it in one of the two day fields.

## How is Quartz cron different?

A Quartz expression has six or seven fields. Seconds come first and an optional year comes last, so the five-field `0 9 * * 1-5` is not a valid Quartz expression. Days of the week are numbered 1 to 7 starting from Sunday, so `1-5` in Quartz means Sunday to Thursday. Use names such as `MON-FRI` to avoid the off-by-one.

Quartz also adds `L` for last, `W` for the nearest weekday and `#` for the nth weekday of the month.

**Quartz expressions from the Quartz CronTrigger tutorial**

| Expression | Meaning in the Quartz documentation |
| --- | --- |
| `0 0 12 * * ?` | Fire at 12pm (noon) every day |
| `0 15 10 ? * MON-FRI` | Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday |
| `0 15 10 15 * ?` | Fire at 10:15am on the 15th day of every month |
| `0 15 10 L * ?` | Fire at 10:15am on the last day of every month |
| `0 15 10 ? * 6L` | Fire at 10:15am on the last Friday of every month |
| `0 15 10 ? * 6#3` | Fire at 10:15am on the third Friday of every month |

_Expressions and meanings are quoted from the Quartz 2.3.0 CronTrigger tutorial._

## How is AWS EventBridge cron different?

An AWS expression is written `cron(minutes hours day-of-month month day-of-week year)`: six required fields, no seconds, and a year from 1970 to 2199. You cannot put a value or `*` in both day fields; one of them must be `?`. Days of the week are 1 to 7 or SUN to SAT, with 1 as Sunday. Expressions that would run more often than once a minute are not supported.

So the Unix `0 9 * * 1-5` becomes `cron(0 9 ? * MON-FRI *)`. AWS's own examples for rules are in UTC, such as `cron(0 10 * * ? *)` for 10:00 am UTC every day. EventBridge Scheduler uses the same six fields and lets you set an IANA time zone for the schedule. AWS now labels scheduled rules as legacy and points to EventBridge Scheduler.

## What does GitHub Actions accept?

The `schedule` trigger takes POSIX cron syntax with five fields. GitHub documents four operators, `*`, `,`, `-` and `/`, and accepts JAN-DEC and SUN-SAT as names. Nicknames such as `@daily` and `@hourly` are not supported.

Schedules run in UTC by default, and the shortest interval is once every 5 minutes. GitHub's documentation also describes an optional `timezone` key that takes an IANA time zone name, where that feature is available. It warns that scheduled runs can be delayed during periods of high load, including the start of every hour, so a job set for minute 0 may start late.

## Which syntax should you write?

The one your scheduler documents. An expression copied from one system to another can be rejected or, worse, accepted with a different meaning, as with `1-5` in the day-of-week field.

When you can choose, start from a five-field expression that uses only numbers, ranges, lists and asterisks. It runs unchanged in Unix cron and GitHub Actions. For Quartz, put a seconds field in front, and for AWS add a year at the end; in both, replace one day field with `?` and write weekdays as names.

## Tools for this

- [Generate a cron expression from a plain-English schedule](https://generate.now/cron): Cron Expression Generator. Writes a cron expression from a description, explains each field of one you paste, and lists the next five run times. It handles five-field expressions and six-field expressions with a leading seconds field.

## Sources

Primary sources, read on 2026-11-11.

- [crontab: schedule periodic background work](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html): The Open Group (POSIX.1-2017). The five fields, their ranges, and the rule for when both day fields are set.
- [crontab(5): Linux manual page](https://man7.org/linux/man-pages/man5/crontab.5.html): cronie project, hosted on man7.org. Step values, names, 0 or 7 for Sunday, random ranges, nicknames, CRON_TZ and the worked day-field example.
- [CronTrigger Tutorial](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html): Quartz Scheduler. The six or seven fields, their allowed values, the special characters and the examples.
- [Setting a schedule pattern for scheduled rules (legacy) in Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html): Amazon Web Services. The cron() format, field ranges, wildcards, limitations and UTC examples.
- [Schedule types in EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html): Amazon Web Services. The same six-field cron format with a configurable IANA time zone.
- [Events that trigger workflows: schedule](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule): GitHub Docs. POSIX five-field syntax, supported operators, UTC default, the five-minute minimum, unsupported nicknames and delays under load.

## Related guides

- [UUID v4 vs v7: Differences and Which to Use](https://generate.now/guides/uuid-v4-vs-v7): UUID v4 is 122 random bits. UUID v7 starts with a millisecond timestamp, so IDs sort by creation time. Bit layouts, collision odds and when to use each.
- [UUID vs ULID vs Nano ID: Size, Sorting and Collisions](https://generate.now/guides/uuid-vs-ulid-vs-nanoid): UUID, ULID and Nano ID compared: length, alphabet, random bits, whether they sort by time, and computed collision odds. With a guide to choosing one.
- [Password vs Passphrase: Which Is Stronger?](https://generate.now/guides/password-vs-passphrase): A random 12-character password and a six-word passphrase are about equally strong. Entropy tables for both, and what NIST SP 800-63B says about length.

[All guides](https://generate.now/guides)
