Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 java.util.Timer 来安排 TimerTask 每 2 小时运行一次。
但是我如何安排一个任务在每天凌晨 2 点运行呢?
这可能很容易,我只是忽略了一些我猜的东西。
提前致谢
您可以将Quartz调度系统与CronTrigger.
CronTrigger
称呼
timer.scheduleAtFixedRate(task, twoAmDate, twentyFourHoursInMillis )
关于 java.util.Timer