-
-
Notifications
You must be signed in to change notification settings - Fork 271
Closed
Description
Bug Report: Incorrect Execution of 0 0 1 */3 * Schedule
Description
When using the node-cron module with the schedule 0 0 1 */3 *, the expected behavior is to execute the task at midnight on the 1st day of January, April, July, and October (i.e., the first day of each quarter). However, the task is also incorrectly executed on December 1st, which does not align with the intended behavior following the GNU crontab syntax: https://www.gnu.org/software/mcron/manual/html_node/Crontab-file.html
Steps to Reproduce
- Install
node-cronin a Node.js project:npm install node-cron
- Create a script with the following schedule:
const cron = require('node-cron'); cron.schedule('0 0 1 */3 *', () => { console.log('Cron job executed:', new Date()); });
- Run the script and observe the task execution on December 1st.
Expected Behavior
The task should only execute on:
- January 1st
- April 1st
- July 1st
- October 1st
Actual Behavior
The task incorrectly executes on December 1st, in addition to the expected dates.
Metadata
Metadata
Assignees
Labels
No labels