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

FieldValueMeaning
Minute0At 0
Hour0At 0
Day of Month1At 1
Month1At January
Day of Week1At 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

**/5*/10*/15*/300
**/2*/3*/6*/120
*1151,15*/2
*11,4,7,101,7
*1-50,615

Next 10 Executions

1.Fri, Jan 1, 2027, 12:00 AM
2.Mon, Jan 4, 2027, 12:00 AM
3.Mon, Jan 11, 2027, 12:00 AM
4.Mon, Jan 18, 2027, 12:00 AM
5.Mon, Jan 25, 2027, 12:00 AM
6.Sat, Jan 1, 2028, 12:00 AM
7.Mon, Jan 3, 2028, 12:00 AM
8.Mon, Jan 10, 2028, 12:00 AM
9.Mon, Jan 17, 2028, 12:00 AM
10.Mon, Jan 24, 2028, 12:00 AM

Ctrl+Shift+C to copy expression

Customize this expression