0

I am trying to run the code of the node cron job but it is not working when I specify the specific time. Below is the code.

var job = new cronJob({
  cronTime: '00 01 16 * * 1-5',
  onTick: function() {
    console.log("hello");
  },
  start: true,
  timeZone: 'America/Los_Angeles'
});
job.start();
JN_newbie
  • 5,492
  • 14
  • 59
  • 97

1 Answers1

0

it should print hello every workday at 04:16:00 pm. I want this behavior

Try to change your code to:

var job = new cronJob({
  cronTime: '00 16 16 * * 1-5',
  onTick: function() {
    console.log("hello");
  },
  start: true
});
Nour Sammour
  • 2,822
  • 1
  • 20
  • 19