suchen

Heim  >  Fragen und Antworten  >  Hauptteil

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

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

大家讲道理大家讲道理2890 Tage vor650

Antworte allen(1)Ich werde antworten

  • 天蓬老师

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

    首先,

    1. cron不能保证一定在12:05:00:000启动job。

    2. 你app启动的时间自己和 0/5 对齐就可以了

    Antwort
    0
  • StornierenAntwort