How to run node.js cron on every day at specific time?

My problem is that i want to run cron job at 10:00 of night.

This is my code:

var job = new CronJob('0 0 0 * * *', function() {

})

Answers:

Answer

It's quite simple:

Modify your code with the below code:

var job = new CronJob('0 22 * * *', function() {
 //will run at 10:00 PM everyday
})

For more information: https://www.npmjs.com/package/node-schedule

Here you can customize time according to you requirement: https://crontab.guru/#0_22___*

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.