For a continuously-running servlet, you would want to create
a new thread that sleeps for some time interval (the
interval isn't important if long enough because it won't add
any appreciable burden to the CPU) and calls the
java.util.Calendar method ( Calendar timeStamp = new
Calendar.getInstance();), which will return a
GregorianCalendar object with the current time and date.
The SimpleTimeZone object sets your time zone as an offset
of Greenwich Mean Time (GMT) and will be set each time a new
Calendar object is created.  See java.util.Calendar API for
method details.

-mark

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's
Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On
Behalf Of
Andr�s Wagner
Sent: Thursday, January 04, 2001 1:24 PM
To: [EMAIL PROTECTED]
Subject: Cheking the Date every Day


Hi, anyone knows how to make a servlet that chek the date
every day?
Should I use Threads to do this?
And another question, when I make a GregorianCalendar and i
set a
specific TimeZone it remains as the default one.

Thanks!
--
__________________________________
Andr�s Wagner Acu�a
Estudiante Ing. Civil Industrial
Universidad Adolfo Iba�ez

ICQ: 39542425
__________________________________

"Programing today is a race between software engineers
striving to
build bigger and better idiot-proof programs, and the
universe trying
to produce bigger and better idiots...
                                ...So far the universe is
winning".

-Rich Cook

____________________________________________________________
_______________
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

___________________________________________________________________________
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