Package com.luna.common.cron
Class CronUtil
java.lang.Object
com.luna.common.cron.CronUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkCronOneTime
(String cron) static Date
formatDateByCron
(String cron, long time) static String
convert Date to cron ,eg.static String
getCronAfterMinutes
(int minute) 相对于当前时间多少分钟后的执行任务的cron表达式static String
getCronAfterSeconds
(int second) static String
getCronEveryXMinutes
(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
-