Getting datetimes from cron format using javascript

Does anyone know of any existing solutions using javascript that can parse crontab and return all datetime instances between start and end date?

those. if I have 0 * * * *, run 24/10/2011 16:00and run 24/10/2011 19:00, then it will return:

24/10/2011 16:00,
24/10/2011 17:00,
24/10/2011 18:00
+5
source share
2 answers

You might want to check out Later.js , which can parse a Cron expression and compute the following occurrences.

var schedule = cronParser().parse('* */5 * * * *', true);
var results = later(60).get(schedule, 100, startDate, endDate);
+10
source

All Articles