Cron on the First Monday of January
Schedule a cron job on the first Monday of January at midnight using 0 0 1 1 1. Field breakdown for rare annual-weekday scheduling edge cases in cron.
Cron Expression
0 0 1 1 1
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | 0 | At 0 |
| Day of Month | 1 | At 1 |
| Month | 1 | At January |
| Day of Week | 1 | At Monday |
Detailed Explanation
The cron expression 0 0 1 1 1 demonstrates an important cron edge case involving the interaction between Day of Month and Day of Week fields.
Field-by-field breakdown:
0(Minute): At minute 0. The task fires at the top of the hour.0(Hour): At hour 0 (midnight / 12 AM). The task runs at the start of the day.1(Day of Month): On the 1st day of the month.1(Month): In January only. This restricts execution to the first month of the year.1(Day of Week): Monday only. The value 1 represents Monday.
Important edge case: When both Day of Month and Day of Week are specified (neither is *), standard cron uses OR logic. This means the expression fires on January 1st OR on any Monday in January, not just on January 1st when it falls on a Monday. This is one of the most commonly misunderstood behaviors in cron. If January 1st is a Wednesday, the job will still run on January 1st AND on every Monday in January (the 6th, 13th, 20th, 27th). To truly run only when January 1st is a Monday, you would need a script guard: [ "$(date +\%u)" = "1" ] && your_command with expression 0 0 1 1 *. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Educational example demonstrating cron's OR logic for Day of Month and Day of Week fields, useful for understanding scheduling edge cases before production use.
Try It — Interactive Builder
at min 0, at hour 0, on day 1, in month 1, on DOW 1
Next 10 Executions
Ctrl+Shift+C to copy expression