You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Makundi <ma...@koodaripalvelut.com> on 2008/12/16 21:22:55 UTC

Wicket and time zones, wrong month?

Hi!

I am using org.apache.wicket.datetime.PatternDateConverter to convert
my date objects (in a select combo) into strings.

The funny thing is that on my test server the debug output says:

AbstractCalendarPanel - Date 2008-06-01 converted into "may" zone Etc/GMT

On my development computer the debug output says:

AbstractCalendarPanel - Date 2008-06-01 converted into "june" zone
Europe/Bucharest

Looking deeper into the converter, it does have the ability to use
client time zone. However, that is not what I want. I would like it to
use java TimeZone.getDefault(), but apparently this is not what
happens because sun.util.calendar.ZoneInfo[id="EET" ...

I would like to avoid this kind of 'surprises' in the future. Is there
any way to centrally reset the server time zones (for all wicket's
purposes, don't want more surprises ... or was this documented
somewhere)?

To fix this particular occurrence, I added the following line:

public class WicketApplication {
 static {
    DateTimeZone.setDefault(DateTimeZone.forTimeZone(TimeZone.getDefault()));
 }
}

**
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org