cron expression parsing into java date

前端 未结 4 625
旧时难觅i
旧时难觅i 2021-02-08 02:38
  • 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.
4条回答
  •  情歌与酒
    2021-02-08 03:14

    Perhaps you can check cron-utils It has some utils to get next/previous execution given certain date, ex.: now. Works with JodaTime, but you could retrieve a JavaDate from there. The library is scheduler agnostic: you just provide a string with a cron expression. Is compatible with JDK6.

提交回复
热议问题