Check your machine time zone settings.
type "echo $TZ" at command prompt. The time zone value is added to the
system time when you get time from servlet. I think that is the reason.

Ravi

Federico Delpino wrote:

> Hi all,
>          I faced a problem with time displayed by a servlet
> running on my system
> The servlet gets and display date/time using the following
> code:
> ................
>            Calendar now = Calendar.getInstance();
>            int month = now.get(Calendar.MONTH) +1;
>
>            String date = now.get(Calendar.DATE) +
>                                    "/" + month +
>                                            "/" +
> now.get(Calendar.YEAR) +
>                                    " " +
> now.get(Calendar.HOUR_OF_DAY)+
>                                    ":" +
> now.get(Calendar.MINUTE)+
>                        ":" + now.get(Calendar.SECOND);
> .................
> The date time displayed is quite wrong (3.5 hours after the
> system time), example
> the servlet says
> 23/3/2000 13:38:46
> while the system time (issuing the date command line) is:
> Thu Mar 23 10:08:49 MET 2000.
> System info: Unix-Alpha system - Apache+Jserv - JDK 1.1.7.
> Does any one help me?
> Thanks in advance
>                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]

--
______________________________________________________________
Ravi Sankar Pabbati,
Wipro GE Medical Systems,
A-1, Golden Enclave, Airport Road, Bangalore,
India - 560 017.
Tel : (91)-(80)-5263121 ext 344 ; Fax :  (91)-(80)-5263520
Visit us on the Internet :  http://www.gemedicalsystems.com
http://www.wiproge.com

___________________________________________________________________________
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