Can anyone please help me in scheduling to run a eclipse java program daily at 8 PM?
I used various methods such as codepro, quartz but i don't know how it works?
Can anyone please help me in scheduling to run a eclipse java program daily at 8 PM?
I used various methods such as codepro, quartz but i don't know how it works?
You can try this:
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
// what to do every 8:00am
}
}, new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2016-2-23 8:00:00"), 24*60*60*1000);
Explain:
Start time: new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2016-2-23 8:00:00");
Period after first start: 24*60*60*1000
= one day in milliseconds.