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]
BEGIN:VCARD
VERSION:2.1
N:;Delpino;Federico
FN:Delpino Federico
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:19991027T094826Z
END:VCARD