Hi there,

 

I have web-app deployed on JBoss and I am having some problems with date
objects :-/ I am trying to set login time to some bean and display this info
on page. In my LoginAction I do:

 

UserSession us = new UserSession(loggedUser);

TimeZone tz = TimeZone.getTimeZone("Europe/Warsaw");

GregorianCalendar cal = new GregorianCalendar(tz);    

Timestamp loginTime = new Timestamp(cal.getTimeInMillis());

us.setLoginTime(loginTime);

request.getSession().setAttribute(USER_SESSION, us);

 

and on my JSP page:

<bean:write name="userSession" scope="session" property="loginTime"  />

 

But the problem is that it takes GMT timezone every time and I am in Poland
(CET +01). What should I do to get string with current time in my timezone ?

 

TIA 

Wojtek

Reply via email to