Sunday, 4 June 2017

how can we execute messages at a particular time daily in nodejs?

I want to execute the message daily at 10'o clock 5 minutes 25 seconds but I tried the program I got an error . ERROR OCCURED: throw patterns[5] + ' is a invalid expression for week day'; ^ is a invalid expression for week day

can anyone help me? Thanks in advance... I am waiting for your reply.

CODE:

var cron = require('node-cron');
cron.schedule('25 05 10 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 January,February,March,April,May,June,July,August,September,October,November,December   Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday ', function(){
    console.log('Time for breakfast');
});


via Vignesh Ravi

No comments:

Post a Comment