Package com.luna.common.cron
Class CronUtil
java.lang.Object
com.luna.common.cron.CronUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckCronOneTime(String cron) static DateformatDateByCron(String cron, long time) static Stringconvert Date to cron ,eg.static StringgetCronAfterMinutes(int minute) 相对于当前时间多少分钟后的执行任务的cron表达式static StringgetCronAfterSeconds(int second) static StringgetCronEveryXMinutes(int x) 周期性任务,每X分钟执行一次static void
-
Constructor Details
-
CronUtil
public CronUtil()
-
-
Method Details
-
getCronAfterMinutes
相对于当前时间多少分钟后的执行任务的cron表达式- Parameters:
minute-- Returns:
-
getCronAfterSeconds
-
getCron
convert Date to cron ,eg. "0 06 10 15 1 ? 2014"- Parameters:
date- : 时间点- Returns:
-
getCronEveryXMinutes
周期性任务,每X分钟执行一次- Parameters:
x-- Returns:
-
formatDateByCron
-
main
- Throws:
Exception
-
checkCronOneTime
- Throws:
RuntimeException
-