Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

in_the_past.js 414B

12345678910111213141516171819
  1. const CronJob = require('../lib/cron.js').CronJob;
  2. // XXX: SEE README GOTCHAS ABOUT WHY THIS COULD BE IN THE PAST!
  3. let d = new Date();
  4. d.setMilliseconds(d.getMilliseconds() + 1);
  5. console.log('Before job instantiation');
  6. const job = new CronJob(
  7. d,
  8. () => {
  9. const d2 = new Date();
  10. console.log('Tick @:', d2);
  11. },
  12. () => {
  13. console.log('complete');
  14. }
  15. );
  16. console.log('After job instantiation');
  17. job.start();