zoukankan      html  css  js  c++  java
  • jsp页面将Date类型的日期的"yyyy-MM-dd HH:mm:ss"格式化显示

    示例如下:

    <table id="contentTable" class="table table-striped table-bordered table-condensed">
            <thead><tr><th>订单编号</th><th>商品名称</th><th>客户名称</th><th>商品成交数量</th><th>商品单价</th><th>成交总额</th><th>交易时间</th><th>订单状态</th><shiro:hasPermission name="sys:order:edit"><th>操作</th></shiro:hasPermission></tr></thead>
            <tbody>
                        <c:forEach items="${page.list}" var="order">
                        <tr>
                        
                    <td>${order.orderId}</td>
                    <td>${order.goodId}</td>
                    <td>${order.shopperName}</td>
                    <td>${order.goodNumber}</td>
                    <td>${order.goodPrice}</td>
                    <td>${order.sumPrice}</td>
                    <%-- <td>${order.saleTime}</td> --%>
                    <td><fmt:formatDate value="${order.saleTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td>${order.orderStatus=="1"?"待审核":(order.orderStatus=="0"?"未通过":"已通过")}</td><!-- 1 代表待审核   0代表未通过  2 代表已通过 -->
                
                <shiro:hasAnyPermissions name="sys:order:edit">
                    <td>
                        <a href="${ctx}/sys/order/form?orderId=${order.orderId}">修改</a>
                        <a href="${ctx}/sys/order/delete?orderId=${order.orderId}">删除</a>
                    
                    </td>
                </shiro:hasAnyPermissions>
                </tr>
                </c:forEach>
            
            </tbody>
        
        </table>

    头部加上:     <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    内容中使用:   <fmt:formatDate value="${post.postDate }" pattern="yyyy-MM-dd HH:mm:ss"/>   显示时分秒

                          或者 <fmt:formatDate value="${post.postDate }" pattern="yyyy-MM-dd"/>     显示时分秒显示

    将时间转换成自己想要的格式      

  • 相关阅读:
    HDU5418.Victor and World(状压DP)
    POJ2686 Traveling by Stagecoach(状压DP)
    POJ3254Corn Fields(状压DP)
    HDU5407.CRB and Candies(数论)
    CodeForces 352D. Jeff and Furik
    CodeForces 352C. Jeff and Rounding(贪心)
    LightOj 1282 Leading and Trailing
    Ural 1057. Amount of Degrees(数位DP)
    HDU 2089 不要62 (数位DP)
    HDU5366 The mook jong (DP)
  • 原文地址:https://www.cnblogs.com/isme-zjh/p/12664101.html
Copyright © 2011-2022 走看看