Hi, all date objects are (see javadoc for java.util.Date) UTC which is neearly GMT. If you want to show localy converted time you must set the timeZone attribute in your converter tag.
I think, but not tested, you can use something like <f:convertDateTime timeZone="<%= TimeZone.getDefault().getID() %>" ... /> in the jsp page. regards ir. ing. Jan Dockx wrote: > Again, you need a timeZone="GMT+5" in your <f:convertDateTime ... /> > > > On 3 Oct 2005, at 14:53, Boris Kovalenko (JIRA) wrote: > > [ > > http://issues.apache.org/jira/browse/MYFACES-656?page=comments#action_12331159 > ] > > Boris Kovalenko commented on MYFACES-656: > ----------------------------------------- > > Still can't fully understand the situation, it is very strange. Base > form: > <t:inputText id="rdate" value="#{currencyrate.rdate}" > readonly="true" styleClass="input" size="10" > > <f:convertDateTime pattern="#{bundle['formats.date.ddmmyyyy']}"/> > </t:inputText> > <t:commandButton action="#{currencyrate.add}" > value="#{bundle['buttons.add']}" styleClass="button" /> > > CurrencyRate::add > public String add() { > id = Constants.NO_ID; > System.out.println(rdate); > return ACTION_EDIT; > } > > rdate here is logged as right date but with HH:MM:SS to 00:00:00 > (this is ok) > but in the form where ACTION_EDIT points > <t:outputLabel for="rdate" value="#{bundle['titles.date']}"/> > <t:inputText id="rdate" value="#{currencyrate.rdate}" > readonly="true" styleClass="input" size="10" > > <f:convertDateTime pattern="#{bundle['formats.date.ddmmyyyy']}"/> > </t:inputText> > > rdate is shown as one day back!!! > > Where is the mistake? I have experimented with date of 02.10.2005 > for example, and my System.out.println(rdate) in > CurrencyRate::getRdate ALWAYS shown me Sun Oct 02 00:00:00 YEKST > 2005. But in input field I see one day back!!! (01.10.2005). Please > help me identify the problem. > > > data conversion problems??? > --------------------------- > > Key: MYFACES-656 > URL: http://issues.apache.org/jira/browse/MYFACES-656 > Project: MyFaces > Type: Bug > Components: Tomahawk > Versions: Nightly > Environment: Windows XP, Mozilla, Resin 3.0.14 > Reporter: Boris Kovalenko > Priority: Critical > > > > Simple form with > <t:inputText id="rdate" value="#{currencyrate.rdate}" > readonly="true" styleClass="input" size="10" > > <f:convertDateTime pattern="#{bundle['formats.date.ddmmyyyy']}"/> > </t:inputText> > rdate is type of Date and constructed with new Date(). Regardles > of f:convertDateTime used the value in input field is always one > day back if time part of date is 00:00:00. IMHO this is problem > with TZ as my TZ is GMT+5. I can't suppose when the problems > occured as I switched from one of the 200509 builds to the lates > nightly (20051001) > > > -- > This message is automatically generated by JIRA. > - > If you think it was sent incorrectly contact one of the administrators: > http://issues.apache.org/jira/secure/Administrators.jspa > - > For more information on JIRA, see: > http://www.atlassian.com/software/jira > > > Met vriendelijke groeten, > > Jan Dockx > > PeopleWare NV - Head Office > Cdt.Weynsstraat 85 > B-2660 Hoboken > Tel: +32 3 448.33.38 > Fax: +32 3 448.32.66 > > PeopleWare NV - Branch Office Geel > Kleinhoefstraat 5 > B-2440 Geel > Tel: +32 14 57.00.90 > Fax: +32 14 58.13.25 > _ > http://www.peopleware.be/ > http://www.mobileware.be/_ > -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
