Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node cron schedule specific time

const CronJob = require('../lib/cron.js').CronJob;

console.log('Before job instantiation');
let date = new Date();
date.setSeconds(date.getSeconds()+2);
const job = new CronJob(date, function() {
	const d = new Date();
	console.log('Specific date:', date, ', onTick at:', d);
});
console.log('After job instantiation');
job.start();
Source by github.com #
 
PREVIOUS NEXT
Tagged: #node #cron #schedule #specific #time
ADD COMMENT
Topic
Name
1+5 =