myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Date output and timezone
Date Sat, 29 Apr 2006 16:03:35 GMT
I would appreciate some suggestions for the handing of dates:
I'm using Tomahawk <t:inputDate .../> to collect a person's date of birth in a backing
bean variable of type Date.
When I subsequently view the date using a simple <h:outputText ../> it displays the
original date minus 1 day, even though the Date variable is set correctly.
For example I enter 01-Jan-1965  and outputText displays 31-Dec-1964.

I'm not using any converters and I assume that the default converter is taking in to account
my timezone, I'm on CET (GMT+1), and calculating 01-Jan-1965 00:00:00 minus 1 hour to display
the GMT time (correct?).

The application is going to be accessed from different timezones but the date display must
be exactly as entered.
What would be the easiest/cleanest way to get around this problem?
I guess I could dynamically set <f:convertDateTime timeZone="#{User.timeZone}"/> to
the user's timezone but I'd rather the date was simply treated as a Date without any time
and timezone.


View raw message