Try changing the convertDateTime tag thusly:

<f:convertDateTime pattern="dd/MM/yyyy" timeZone="CET" />

-Matt

On 9/29/05, Jan Dockx <[EMAIL PROTECTED]> wrote:
1 step further:

Submitting data works ok: if I enter 1/9/2005 in the entry field, the DB ends up with 1/9/2005, 0:00h. So the MyFaces DateTimeConverter converts ok. So far so good. Data that comes from the DB creates a java.util.Date that is 1/9/2005, 0:00h. Ok. When I show it with JSP EL, I see 1/9/2005. Ok. When I show that Date with JSF however, it shows 31/8/2005 23:00h! When I add timeZone="GMT+2", it renders 1/9/2005. We are in Belgium, daylight saving time is active, and we are in GMT+1.

At least, this is inconsistent behavior. And frankly, looking at the code of DateTimeConverter, I don't get it.



On Thursday, September 29, 2005, at 05:28PM, Jan Dockx < [EMAIL PROTECTED]> wrote:

>I'm getting tired.
>
>We have this jsf code:
>
>                1: <h:outputText value="#{enrollmentH.instance.startDate}" /><br />
>                <f:verbatim>2: ${enrollmentH.instance.startDate}<br /></f:verbatim>
>                <x:inputText id="startDate"
>                             value="#{enrollmentH.instance.startDate}"
>                             required="true"
>                             size="10"
>                             maxlength="10"
>                             displayValueOnly="#{not enrollmentH.showFields}"
>                             displayValueOnlyStyleClass="#{enrollmentH.viewMode}">
>                  <f:convertDateTime pattern="dd/MM/yyyy" />
>                </x:inputText>
>
>(ok, it's hacked)
>
>the enrollmentH.instance.startDate is a java.util.Date, 1 september 2005.
>
>What is shown is
>
>31-aug-2005
>2: 2005-09-01
>31/08/2005?
>
>in other words:
>
>h:outputText rendes 31 august
>JSP el renders 1 september
>h:inputText renders 31 august
>
>JSF is one day off!!!
>
>It's probably our fault. We are using a custom build of the main trunk, 2005-09-28, 11:00am CET.
>What are we missing????
>
>

Reply via email to