import static com.cronutils.model.field.expression.FieldExpressionFactory.always;import static com.cronutils.model.field.expression.FieldExpressionFactory.every;import static com.cronutils.model.field.expression.FieldExpressionFactory.on;import static com.cronutils.model.field.expression.FieldExpressionFactory.questionMark;import com.cronutils.builder.CronBuilder;import com.cronutils.model.Cron;import com.cronutils.model.CronType;import com.cronutils.model.definition.CronDefinitionBuilder;public class Test { public static void main(String[] args) { Cron cron = CronBuilder.cron(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ)) .withYear(always()) .withDoW(questionMark()) .withMonth(always()) .withDoM(always()) .withHour(always()) .withMinute(every(5)) .withSecond(on(0)) .instance(); // Obtain the string expression String cronAsString = cron.asString(); // 0 */5 * * * ? * 每5分钟一次 System.out.println(cronAsString); }}
https://github.com/jmrozanec/cron-utils
https://www.cnblogs.com/be-come/p/6165293.html
http://cron.qqe2.com/