I want to run a 'scheduled job' in meteor which needs to be run only once at a specified time. I have the access of the date object. i've tried the below cron
expression but didn't get the expected behavior.
here's the code snippet.
schedule: function(parser) {
var _year = bidStartTime.getFullYear();
var _month = bidStartTime.getMonth();
var _date = bidStartTime.getDate();
var _hours = bidStartTime.getHours();
var _min = bidStartTime.getMinutes();
var bidAsCron = _min+' '+_hours+' '+_date+' '+ _month+' ? '+_year;
console.log('parsed as ' + bidAsCron);
// parser is a later.parse object
// sample parser.cron('25 17 5 10 ? 2015');
// should 5th October 2015 at 5:25 pm
return parser.cron(bidAsCron);
},