search

Home  >  Q&A  >  body text

java - CronExpression 获取本次执行的开始时间

比如cron表达式为 * * 0/5 * * ?的一个job
12:05:00:000进入job,执行时,我要获取12:05:00:000这个时间,注意,不能是12:05:00:023,所以当然不能使用new Date()

大家讲道理大家讲道理2891 days ago662

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 17:50:58

    First of all,

    1. Cron cannot guarantee that the job will be started at 12:05:00:000.

    2. Just align the time when your app starts up with 0/5

    reply
    0
  • Cancelreply