Cron expression generator & parser

Cron expression for the first day of every month

To run a job at midnight on the 1st of every month, use 0 0 1 * *: minute 0, hour 0, day of month 1, every month. @monthly is a shortcut for the same schedule.

Cron expression generator & parser
Preset
Show times in
Next runs
Cron expressionCRON

Press Command or Control plus Enter to run. Tab inserts indentation; press Escape, then Tab, to leave the editor.

Result
Your result will appear here.
Ready1 line · 9 chars

Monthly and yearly schedules

ScheduleExpression
1st of every month at 00:000 0 1 * *
1st of every month at 06:3030 6 1 * *
15th of every month at 12:000 12 15 * *
1st and 15th of every month0 0 1,15 * *
Quarterly: 1 Jan, Apr, Jul and Oct0 0 1 1,4,7,10 *
Yearly on 1 January0 0 1 1 *

The last day of the month

Standard cron has no "last day" value. Schedule the job on days 28 to 31 and let it run only when tomorrow is the 1st (this uses GNU date, as on most Linux systems; % is escaped in crontab):

0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /usr/local/bin/close-month.sh

Quartz and Spring have L

Schedulers with Quartz-style expressions support L for the last day: 0 0 0 L * ? in Quartz. They also add a seconds field, so the fields don't line up with standard cron. Paste only five-field expressions into the tool above.

Frequently asked questions

What happens to a job scheduled on the 31st in a shorter month?

It doesn't run that month. 0 0 31 * * runs only in the seven months that have 31 days. Use the last-day check above instead.

Is @monthly the same as 0 0 1 * *?

Yes, in Vixie cron, cronie and Kubernetes. GitHub Actions doesn't accept shortcuts, so use 0 0 1 * * there.

Why should a monthly report run on the 1st instead of the last day?

On the 1st, the previous month is complete, so a report for it can include every record. Just make sure the job uses last month's dates.

More cron expression generator & parser guides

Open the full cron expression generator & parser →

From the blog