Format Date in Display Tag

JR Galia picture JR Galia · Feb 19, 2013 · Viewed 10.1k times · Source

Im using Struts2 and Display tag library.

<display:table name="list" pagesize="3">
    <display:column property="date" title="DATE" />         
</display:table>

How to format the date column above? e.g. m/d/yyyy

Answer

donramos picture donramos · Feb 19, 2013

Use this:

<display:table name="list" pagesize="3">
    <display:column property="date" title="DATE" format="{0,date,MM/dd/yyyy}" /> 
</display:table>