myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "H. Swaczinna" <swaczi...@wlp-systems.de>
Subject [Tobago] Problem with DateTimeConverter
Date Wed, 20 Dec 2006 22:59:08 GMT
Hello,

I've got a tc:date in my page which represents a java.util.Date in
my bean. The Date is initialized with
Date date = (new GregorianCalendar(2006, 8, 1)).getTime(), so the
time part is 00:00:00. Date.toString() prints "Fri Sep 01 00:00:00 CEST 2006", which is correct.
But in the page, I see "31.08.2006" (with 
<f:convertDateTime pattern="dd.MM.yyyy" />). When I submit the page, the 
date is written back as "Thu Aug 31 02:00:00 CEST 2006", which is 
definitely wrong. When I initialize the date with
date = (new GregorianCalendar(2006, 11, 1)).getTime(), I got back
"Thu Nov 30 01:00:00 CET 2006" from the page. So, the behaviour is
different, if the date lies in the daylight saving period or not, and
the day of month is always miscalculated by one day minus one or to hours.

Maybe, the initialization of the date might be wrong or the converter
is not setup correctly. But I think, there's also a problem in the
converter.

Regards
Helmut

Mime
View raw message