node-cron / node-cron

A simple cron-like job scheduler for Node.js
ISC License
2.97k stars 253 forks source link

Getting error on expression 0 6/12 * * * #408

Open henry-devlpr opened 11 months ago

henry-devlpr commented 11 months ago

Below error getting

~/node_modules/node-cron/src/pattern-validation.js:92 throw new Error(${patterns[2]} is a invalid expression for hour); ^

Error: 6/12 is a invalid expression for hour


I want to run cron 6am and 6pm everyday. Thanks in advance.

Z2026 commented 10 months ago

0 6,18 * * * would be the correct expression. Using this, the cron job will run at 6 and 18 hours, which are 6am and 6pm everyday.