[jboss-user] [JBoss Seam] - Problem with decrementing dates

bfo81 do-not-reply at jboss.com
Mon Jul 31 10:36:03 EDT 2006

I have an entity Person with a Birthday (property annotated with @Temporal(TemporalType.DATE)).

e.g. John Sixpack, 1976-07-04

There's a JSF file for editing it, and it includes:
<h:inputText value="#{person.birthday}">
  |     <f:convertDateTime type="date" />
  | </h:inputText>

Problem: The input text field shows the wrong date: 1976-07-03 instead of 1976-07-04.

For debugging I added the following after the h:inputText
<h:outputText value="#{person.birthday}" />
  | <h:outputText value="#{person.birthday}">
  |     <f:convertDateTime type="both" />
  | </h:outputText>
and the page now displays:
anonymous wrote : [__1976-07-03___] (input field with converter is wrong)
  | 1976-07-04  (normal output is correct)
  | 1976-07-03 23:00:00  (output field with converter is wrong)
The database clearly says 1976-07-04 (it's a date field without time). But as you can see, the converter subtracts one hour, what results in a birthday one day earlier each time the user saves the edited entry.

Well, it looks like a timezone (GMT+1) or summertime/daylight saving time problem, but I don't know what to do or where to start. Did anyone have similar experiences? Or a hint for solving this problem?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961888#3961888

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961888

More information about the jboss-user mailing list