Yearly
0 0 31 12 *
Run once a year, midnight at the start of December 31st.
This preview is live: the table below shows the actual next run times for 0 0 31 12 * in your time zone, recomputed in your browser. Change the expression, dialect, or zone to experiment, then copy the result.
What 0 0 31 12 * means
0 0 31 12 * fires at the very start of December 31st, midnight as the last day of the year begins. It is the slot for end-of-year close work that needs the whole final day to run, as opposed to 0 0 1 1 * which fires after the year has already turned.
The distinction matters for fiscal and reporting jobs: closing the year's books on the morning of the 31st, versus archiving the completed year on the 1st. Pick the boundary that matches whether you want the last day included or excluded.
Field-by-field breakdown
Unix cron has five fields. Here is what each one is doing in this expression:
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | minute = 0 |
| Hour | 0 | hour = 0 |
| Day of month | 31 | day-of-month = 31 |
| Month | 12 | month = 12 |
| Day of week | * | every day-of-week |
New Year's Eve at midnight in every scheduler
The same cadence written for the seven cron dialects you are most likely to meet. Copy the line for the system you target, the field count and day-of-week numbering differ between them.
| Scheduler | Expression | Copy |
|---|---|---|
| Unix / crontab | 0 0 31 12 * | |
| GitHub Actions | 0 0 31 12 * | |
| Kubernetes CronJob | 0 0 31 12 * | |
| Vercel Cron | 0 0 31 12 * | |
| Quartz | 0 0 0 31 12 ? * | |
| Spring | 0 0 0 31 12 ? | |
| AWS EventBridge | 0 0 31 12 ? * |
When you would use 0 0 31 12 *
- Year-end close that must finish before midnight Dec 31.
- Final annual reports covering the calendar year.
- Pre-rollover data snapshots.
The gotcha worth knowing
Midnight on the 31st is the *start* of the 31st, not the end of the year. If you want "after the year ends", that is 0 0 1 1 * (Jan 1). Off-by-one-day errors here are common in financial code.
People also search for
0 0 31 12 * FAQ
What does the cron expression 0 0 31 12 * mean?
0 0 31 12 * means: Run once a year, midnight at the start of December 31st. 0 0 31 12 * fires at the very start of December 31st, midnight as the last day of the year begins. It is the slot for end-of-year close work that needs the whole final day to run, as opposed to 0 0 1 1 * which fires after the year has already turned.
How do I write "new year's eve at midnight" in GitHub Actions?
Use 0 0 31 12 * in the schedule's cron field. Midnight on the 31st is the *start* of the 31st, not the end of the year. If you want "after the year ends", that is 0 0 1 1 * (Jan 1). Off-by-one-day errors here are common in financial code.
How do I write "new year's eve at midnight" for AWS EventBridge?
EventBridge uses six fields with a required year and a ? placeholder in one day field: 0 0 31 12 ? *. Wrap it as cron(0 0 31 12 ? *) in the console or CloudFormation.
What is the Quartz equivalent of 0 0 31 12 *?
Quartz is seconds-first with a trailing year, so the equivalent is 0 0 0 31 12 ? *. Remember Quartz numbers Sunday as 1, the opposite of Unix.
Related cron patterns
More cron tools
Browse the full set of cron pattern pages, or jump to the interactive tools: the cron expression builder for designing a schedule from scratch, the cron cheat sheet for a side-by-side reference, the cron timezone translator for moving a schedule between zones and dialects, and the GitHub Actions cron picker for DST-stable CI schedules.