简体   繁体   中英

java timer - how to scheduletask at a particular time in the future

I have used java.util.Timer to schedule TimerTask to be run every 2 hours .

But how do I schedule a task to run say everynight at 2 am ?

This might be something easy, I am just overlooking something I guess.

Thanks in Advance

您可以将Quartz调度系统与CronTrigger一起使用。

Call

timer.scheduleAtFixedRate(task, twoAmDate, twentyFourHoursInMillis )

on java.util.Timer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM