ComfyToolkit

Cron Expression

Parse cron expressions to plain text or build schedules.

Expression
Build

Fix the expression to use the builder.

In plain English

node-cron needs 6 fields, got 5

Next runs

node-cron Expression Parser

node-cron accepts an optional leading seconds field, making six fields in total. This page opens in that dialect, so the first number is seconds rather than minutes.

Misreading which field is which is the single most common cause of a job that fires sixty times more often than intended.

Six fields, seconds first

The middle example is the trap. Written in five-field Unix form, */5 in the leading position means every five minutes. Here it means every five seconds.

0,30 * * * * *   at :00 and :30 of every minute
*/5 * * * * *    every 5 seconds
0 */5 * * * *    every 5 minutes, on the minute

Day-of-week numbering matches Unix

Unlike Quartz, node-cron keeps the Unix convention of 0-6 starting at Sunday. So an expression copied from a crontab keeps working when a seconds field is prepended, which is not true of a copy into Quartz.

Second-level schedules deserve scrutiny

A job firing every few seconds will overlap itself the moment it takes longer than its interval, and the scheduler will happily start another copy. Add a lock, or use a runner with overlap protection, before scheduling anything below about a minute.

Timezone support is explicit

node-cron accepts a timezone option per scheduled task rather than inheriting the system clock, which sidesteps the daylight saving problem that breaks plain crontab entries twice a year.

Set it explicitly even when the server is already on UTC. A future migration to a differently configured host is exactly when an implicit assumption becomes an incident.

Open the full Cron Expression