从form里取出这个date对象再用struts标签可以显示,但怎样才能用控制输出得格式

解决方案 »

  1.   

    JSTL日期格式化
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <fmt:formatDate value="${student.birthday}" pattern="yyyy年MM月dd日"/> 
      

  2.   

    <bean:write name="list" property="dishTime" filter="true" format="yyyy-MM-dd HH:mm:ss" />
      

  3.   


    JSTL日期格式化 
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <fmt:formatDate value="${student.birthday}" pattern="yyyy年MM月dd日"/> 
    <bean:write name="list" property="dishTime" filter="true" format="yyyy-MM-dd HH:mm:ss" />
      

  4.   

    <bean:write name="list" property="dishTime" format="yyyy-MM-dd HH:mm:ss" />
      

  5.   

    <bean:write name="list" property="dishTime" filter="true" format="yyyy-MM-dd HH:mm:ss" />
      

  6.   

    <bean:write name="LabEnvironmentCheckForm" property="date.time" formatKey="common.format.Year" />common.format.Year是在资源文件中配置你要显示日期的格式。