hi,
  i tested this with a servletrunner and ofcourse as an application,
it gives same time

ravi


Federico Delpino wrote:

> Hi all, I have a problem using dates in servlets. The
> following code
>
> =====
> Calendar now = Calendar.getInstance();
> String date = now.get(Calendar.DATE) +
>                "/" + (now.get(Calendar.MONTH) +1) +
>                "/" + now.get(Calendar.YEAR) +
>                " " + now.get(Calendar.HOUR_OF_DAY)+
>                ":" + now.get(Calendar.MINUTE)+
>                        ":" + now.get(Calendar.SECOND);
> System.out.println(date);
> ==================
> in a Java application returns the correct date. Yet the same
> code inside
> a servlet running on the same system gives me a different
> value (2 hours
> in advance). Where I'm wrong ??
> Thanks.
> federico
> ------------------------------------------------------------
> ------
> Federico Delpino                       Tel. 39-51-20-95722
> Osservatorio Astronomico di Bologna    Fax. 39-51-20-95700
> via Ranzani,1 - 40126 Bologna, Italy   e-mail:
> [EMAIL PROTECTED]

___________________________________________________________________________
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