struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc BEGUIGNEAU <marc_beguign...@yahoo.fr>
Subject How I can format a date to display
Date Fri, 27 Jun 2003 07:15:12 GMT
Hello,

With Struts, I'm using Torque to access a database
under Oracle 9.

The result of a search in an array of bean (values
object bean).

This bean as an property witch is a date. When I
iterate this array in my JSP page, the date are
displaying under US format (year/month/day). To format
the display to french format (day/month/year), I
convert the date to a string with the
SimpleDateFormat, and then I parse the result string
into a date and try to display it. But the result is a
date with the FULL format.

This is an extract of the code I use to convert:

<code>

SimpleDateFormat dateFormat = new
SimpleDateFormat("dd/MM/yyyy");

String tempDate =
dateFormat.format("offer.getOfferDate");

try {

offerVO.setOfferDate(dateFormat.parse(tempDate));

} catch (ParseException e) {
System.out.println()e.toString();
}

</code>

My question is: how do you display date if you want to
have a specific formating display?

Curently, I have solv the problem by using a String
property in my VO bean, but this solution is
temporary.

Thank you in advance.

Marc

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran├žais !
Yahoo! Mail : http://fr.mail.yahoo.com

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


Mime
View raw message