I have servlets that do exactly what you want.
During initialization, the servlet notes down the current time, and the
time it's supposed to regularly perform a job. It then calculates the
number of hours for it to initially sleep before reaching the job time.

It then sleeps for that time period, does the job, then regularly sleeps
for 24 hours.

airlan.


AKS: Boban Acimovic wrote:
>
> I want to write small Java application that will send me e-mail at the right time.
> I already know how to mail, but how to work that action exactly in some predefined 
>time.
> I will keep dates and times in database and I know how to access data.
> I thought to use Thread.sleep() etc. and I can work out that way, checking local 
>time,
> but is there any API that I can use? On example, to say do something in 8:30 
>tomorrow.
> Any help will be appreciated. Thanks.
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to