haifa-reminder/node_modules/cron/examples/get_next_runs.js

25 lines
393 B
JavaScript
Raw Normal View History

2023-07-26 11:01:58 +00:00
const CronJob = require('../lib/cron.js').CronJob;
const job = new CronJob(
'0 * * * * *',
function() {
console.log('Date: ', new Date());
},
null,
true
);
console.log('System TZ next 5: ', job.nextDates(5));
const jobUTC = new CronJob(
'0 * * * * *',
function() {
console.log('Date: ', new Date());
},
null,
true,
'UTC'
);
console.log('UTC next 5: ', jobUTC.nextDates(5));