本文介绍了cron表达式解析为java date的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
- 我的数据库具有 10 18 16吗?* SUN,MON,WED,FRI * cron表达式,然后如何将其转换为Java日期.
- 如何与当前时间进行比较.
- 还有一个是如何与cron表达式(即 10 18 16)进行比较?* SUN,MON,WED,FRI * 和 0 30 9 30 *?
- 请解释使用石英或弹簧调度的示例代码.
- my database having 10 18 16 ? * SUN,MON,WED,FRI * cron expression then how to convert into Java date.
- how to comparing with present day time.
- and one more is how to compare to cron expressions i.e. 10 18 16 ? * SUN,MON,WED,FRI * and 0 30 9 30 * ?
- please explain the sample code using quartz or spring scheduling.
请使用:
import org.springframework.scheduling.support.CronSequenceGenerator; final String cronExpression = "0 45 23 * * *"; final CronSequenceGenerator generator = new CronSequenceGenerator(cronExpression); final Date nextExecutionDate = generator.next(new Date());...然后我建议使用Joda DateTime进行日期比较.
...and then I suggest use Joda DateTime for date comparison.
更多推荐
cron表达式解析为java date
发布评论