if you are not using the jstl tags, you can also put a convenience method in
your bean that looks something like this. refer to the java.text.DateFormat
javadoc for how to format based on the parameters you pass to
getDateTimeInstance.
public String getDateFormatted() {
DateFormat df =
DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.SHORT);
return df.format(getDate());
}
From: John Espey [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: Date format question
Date: Wed, 5 Feb 2003 19:36:23 -0600
the JSTL format parseDate tag will do the trick for you
-Original Message-
From: Swish [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 7:34 PM
To: Struts Users Mailing List
Subject: Date format question
Hello,
I was wondering if there is a way to use the bean:write tag to convert a
string in sql time stamp format to a format of my choosing. I believe one
can write a Date object out using bean:write ...format=dd/MM//, but
can I convert a string 2002-12-25 00:00:00 to 12/25/2002. Thanks in
advance for your suggestions!!!
-
Post your free ad now! Yahoo! Canada Personals
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]