以上是我的代码,我想将其用作通知调度程序,但无法正常工作
const nodeSchedule = require('node-schedule');
var a = new Date();
let rule2 = new nodeSchedule.RecurrenceRule();
rule2.second = a.getSeconds();
rule2.minute = a.getMinutes() + 2;
rule2.hour = a.getHours();
rule2.year = a.getFullYear();
rule2.month = a.getMonth() + 1; // beware: January = 0; February = 1, etc.
rule2.date = a.getDate();
rule2.tz = 'America/Araguaina';
var job = nodeSchedule.scheduleJob('demo', rule2, function () {
console.log('worked..');
});
console.log(job)