Search code examples
javatimercalendartimezonefrequency

Running a method every 15 minutes, every day, between certain times


I want to run a method every 15 minutes, every day, between 08:01:00 and 16:31:00 London time.

So something like this:

foo(); //run every 15 mins, everyday, between 08:01:00 and 16:31:00.

public void foo(){
//do stuff
} 

I have tried using Calendar and Timer but I cannot get this to work.

Thanks for our help.


Solution

  • You can use quartz-scheduler

    I have been using it for a while and it works perfectly.