You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by us...@arcor.de on 2004/06/09 15:28:52 UTC

Formatting and Validating a Date depending on the locale

Hi,

i want to format a date with the message ressources bundle depending on the locale. Is there a possibilty to do that?
I found  something like this
app_de.properties
welcome.message=bla {0] blub {1,date,mm:HH dd.MM.yyyy}
app_en.properties
welcome.message=bla {0] blub {1,date,HH:mm dd-MM-yyyy}

<bean:define id="userName" name="sessionuser" property="login" type="java.lang.String"/>
<bean:define id="lastLogin" name="sessionuser" property="lastLogin" type="java.util.Date"/>	        <bean:message key="welcome.message" arg0="<%=userName%>" arg1="<%lastLogin%>"/>

But if use this, i get an error because arg1 is no String and when i take the toString, i get the error message 'no valid date object'

How can i solve this problem?

Greets
Olli






---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org