I am trying to set a scheduled task in java to run once a day.
The problem is that it only works on the first day.
Any idea y?
thank
log.info("Schdualing midnight task");
Timer timer = new Timer();
Calendar date = Calendar.getInstance();
date.set(Calendar.HOUR_OF_DAY, 23);
date.set(Calendar.MINUTE, 30);
date.set(Calendar.SECOND, 0);
timer.schedule(new EndOfDayRatesTimerTask(new MidnightQuotesEvent()),
date.getTime());
source
share