hi,
you can use, <bean:write> with the format attribute.
eg:-
<bean:write name="order" property="createdDate" format="dd/MM/yyyy"/>
Regards,
Nuwan
----- Original Message -----
From: "Neil Meyer" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, March 07, 2007 4:19 PM
Subject: Struts Date Formatting
Hallo,
I would like to find a struts tag that can do date formatting for me?
I tried to do it within my objects but it keeps on giving me exceptions
Code used.
String date_ = "2007-03-07 00:00:00"
SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy");
return formatter.format(date_);
FAILED
Date now = new Date();
// Print the result of toString()
String dateString = now.toString();
System.out.println(" 1. " + dateString);
SimpleDateFormat format = new SimpleDateFormat("dd MMM yyyy");
try {
Date parsed = format.parse(dateString);
}catch(Exception e){}
FAILED
Any help either the struts formatting or the way to fix it will really be
appreciated.
Kr
Neil Meyer
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]