• 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"/>     显示时分秒显示

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

  • 相关阅读:
    发音技巧
    SCROM标准和一些概念(转)
    我要告诉测试新手的 (转)
    LCMS与LMS
    SCORM标准的LMS ELearning 学习平台介绍
    【转载】经常在网上看人家的帖子,分享给组里面的兄弟共赏
    选择学习管理系统(LMS)不可忽略的十大要素
    委托(delegate)的使用
    LMS/LCMS相关概念简介
    软件测试
  • 原文地址:https://www.cnblogs.com/isme-zjh/p/12664101.html
Copyright © 2020-2023  润新知