Cron expression generator
The cron expression generator builds a schedule once and writes it in four dialects: classic 5-field Unix cron, 6-field cron with seconds for node-cron and Spring, Quartz, and AWS EventBridge, each with its own field order and weekday numbering.
Every 5 minutes.
*/5 * * * * in standard 5-field cron
For classic 5-field crontab, crontab.guru is the tool and has been for years. This page is for the expressions it does not read: the ones with a seconds field, Quartz with its question marks, and AWS with its year. They look alike, and a schedule copied from one into another either fails to parse or, worse, runs on the wrong day.
Cron expression generator with 6 fields: two different sixth fields
"6 fields" means two different things. Quartz, Spring and node-cron add seconds at the front: second, minute, hour, day of month, month, day of week. AWS EventBridge adds a year at the end: minute, hour, day of month, month, day of week, year. Same count, shifted by one field: paste an AWS expression into Spring and every minute value becomes a second. Check which end the extra field is on before anything else.
Cron expression generator with seconds
node-cron takes an optional seconds field first. Spring @Scheduled requires it. Both keep Unix weekday numbers, 0 to 7, where 0 and 7 are Sunday. So */10 * * * * * is every 10 seconds, and 0 0 9 * * 1-5 is 09:00 on weekdays. A plain Linux crontab rejects all of these: its smallest unit is a minute.
Quartz cron expression generator
- Fields: second, minute, hour, day of month, month, day of week, and an optional year.
- Weekdays are 1 to 7 from Sunday. 1 is Sunday, 2 is Monday. Unix
1-5becomes Quartz2-6, orMON-FRI, which never drifts. - One of the two day fields must be
?. Unix0 9 * * 1-5is Quartz0 0 9 ? * MON-FRI. - Extras:
Lfor last,Wfor nearest weekday,#for nth weekday.6#3is the third Friday.
AWS cron expression generator for EventBridge
- Wrapped as
cron(minutes hours day-of-month month day-of-week year). Six fields, no seconds. - Weekdays are 1 to 7 from Sunday, like Quartz. Same
?rule:cron(0 9 * * * *)fails,cron(0 9 * * ? *)runs daily. - Legacy EventBridge rules always run in UTC. EventBridge Scheduler takes a time zone.
- Nothing faster than once a minute.
The same conversion as a function you can paste into Node:
// 5-field Unix cron in, seconds / Quartz / AWS out.
function convert(unix) {
const [min, hour, dom, month, dow] = unix.trim().split(/\s+/);
if (dom !== '*' && dow !== '*') {
throw new Error('Quartz and AWS cannot OR the day fields');
}
if (/-7\b/.test(dow)) throw new Error('Write Sunday as 0 in a range');
// Unix weekdays 0-7 (0 and 7 = Sunday) become 1-7 from Sunday.
const weekday = dow.replace(/\d+/g, (d) => String((Number(d) % 7) + 1));
const days =
dow === '*'
? `${dom.replace(/^\*\//, '1/')} ${month} ?`
: `? ${month} ${weekday}`;
const time = [min, hour].map((f) => f.replace(/^\*\//, '0/')).join(' ');
return {
seconds: `0 ${unix.trim()}`, // node-cron, Spring @Scheduled
quartz: `0 ${time} ${days}`,
aws: `cron(${time} ${days} *)`,
};
}
console.log(convert('0 9 * * 1-5'));
// {
// seconds: '0 0 9 * * 1-5',
// quartz: '0 0 9 ? * 2-6',
// aws: 'cron(0 9 ? * 2-6 *)'
// }Logdash vs crontab.guru
| Feature | Logdash | crontab.guru |
|---|---|---|
| Classic 5-field crontab | Yes | Yes, and the reference everyone links |
| Seconds, Quartz and AWS dialects | All three, converted from one schedule | 5 fields only |
| Monitoring a nightly job | Push monitors expect a ping every check, 15 seconds on Pro | Cronitor, from the same team, watches any schedule |
When crontab.guru is the better pick
- Your schedule lives in a Linux crontab or a GitHub Actions workflow. Both use 5 fields and crontab.guru reads them best.
- You need to know when a job that runs hourly or nightly did not run. Cronitor checks each run against its schedule. Logdash push monitors do not.
Know when the scheduler dies
A seconds field is useful for one thing in monitoring: a heartbeat from a worker or scheduler process that should never stop.
import cron from 'node-cron';
cron.schedule('*/10 * * * * *', async () => {
await fetch('https://api.logdash.io/ping/<monitorId>', { method: 'POST' });
});- Create a push monitor On Pro, add a push monitor to the service and copy its id. The ping URL is public: no auth header, no body.
- Start the heartbeat Run the snippet inside the worker. Pro evaluates push monitors every 15 seconds, and a ping every 10 lands in every window.
- Kill the process Stop the worker. Within 30 seconds a check window passes with no ping, the monitor flips to down, and a Telegram alert arrives naming it.