java - Cron Expression To List of Dates/Timepoints -
i wondering efficient way/best library parse cron expression , return list of time points in java.
for example have cron expression, say, fire every minute in october 2010
, list/array of epoch times (or other date format) returned correspond times trigger fires.
thanks
you use org.quartz.cronexpression.getnextvalidtimeafter() . using method can iteratively many trigger times wish.
you have decide starting point of iteration, current moment or epoch or smth else.
and can parse string cron expression org.quartz.cronexpression
using constructor cronexpression(string cronexpression).
edit: can find similar functionality in spring framework's cronsequencegenerator. both used in similar iterative fashion check 1 suits best regarding performance etc.
Comments
Post a Comment