import java.text.ParseException;
import java.util.Date;
import org.quartz.CronExpression;
public class CronTester {
public static void main(String[] args) throws ParseException {
final String expression = "0 0/30 01-06 * * ?";
final CronExpression cronExpression = new CronExpression(expression);
Date date = new Date();
for (int i = 0; i < 20; i++) {
date = cronExpression.getNextValidTimeAfter(date);
System.out.println(date);
}
}
}
http://en.wikipedia.org/wiki/Cron
http://www.cronmaker.com/
No comments:
Post a Comment