public static List<String> getRecentTriggerTime(String cron) {
		List<String> list = new ArrayList<String>();
		try {
			CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
			cronTriggerImpl.setCronExpression(cron);
			// 这个是重点,一行代码搞定
			List<Date> dates = TriggerUtils.computeFireTimes(cronTriggerImpl, null, 8);
			SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			for (Date date : dates) {
				list.add(dateFormat.format(date));
			}
			
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return list;
	}

 转自:https://blog.csdn.net/loveLifeLoveCoding/article/details/80447836

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-01-07
  • 2021-08-26
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-01-07
  • 2021-08-19
相关资源
相似解决方案