Hi Mahalkar,

  You can use JSTL to do that work on your JSP page. Just use formatting standard tags.
  As Mark said, it is piece of cake. 
  You can use:

    <fmt:formatDate value="{$my_property}" pattern="my_pattern"/>

  Formatting pattern is exactly the same as patterns used in SimpleDateFormat.
  Look at JSTL reference docs to more details.

Regards,
 Daniel Silva  


 
--- Mark Galbreath <[EMAIL PROTECTED]> wrote:
> Just use java.text.DateFormat in your action class and set a String property
> in your form bean with the result.
> 
> Easy as pie.
> 
> -----Original Message-----
> From: Abhijeet Mahalkar [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 17, 2003 8:45 AM
> To: Struts Users Mailing List
> Subject: Re: <bean:write property=""> Format a Date ?
> 
> 
> I don't thing struts provide you formating date functionality as i never
> tried also but frankly it will take another 20 min. to write a function for
> formatting date..
> use string.substring methods and all after retriving the date from DB using
> getStirng()
> or use to_char(datefield,'dd/mm/yyyy hh24:mi:ss') or any other format u
> want. and if you are working with Java Date  class then calculate the long
> value of that with
> 
> String s  = date.getDay()+"/"+ getMonth()+"/"getYear() functions it's really
> simple...
> 
> regards
> abhijeet
> 
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: "Struts-User" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 17, 2003 6:00 PM
> Subject: <bean:write property=""> Format a Date ?
> 
> 
> one of my Bean propertys is a Date and i want to output it formated,
> is there a way to do that with struts ?
> 
> 
> Mit freundlichen Gr��en
> 
> Christian Reps, Dipl. Inf. (FH)
> Web Applications
> 
> 
> ---------------------------------------------------------------------
> 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]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to