I would like to use Java Timer and TimerTask to do a Job everyday evening at 5 O’ clock.
Please help me to solve this problem.
Problem with below methods as I think…
schedule(TimerTask task, Date time)
—-Date can be specified for first day only not for forthcomingdays available.
schedule(TimerTask task, Date firstTime, long period)
—-initial starting time and after how long it is to be executed can be given,
here if I start initlally my scheduler at 4 O’ Clock evening then how to mention the next execution time. If I set 1 hour delay it will call after every one hour.
schedule(TimerTask task, long delay)
–This is not applicable which will do things based on start times.
schedule(TimerTask task, long delay, long period)
–This is not applicable which will do things based on start times.
well the more appropriate answer is the one by Grooveek
but as an alternative