• 日期、时间格式 综合


    jsp:

    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    
    <fmt:formatDate value="${log.operationTime }" pattern="yyyy-MM-dd HH:mm:ss" />

    Javascript:

    /** 在页面指定区域打印时间 */
            printDateInfo : function() {
                var day = "";
                var month = "";
                var ampm = "";
                var ampmhour = "";
                var myweekday = "";
                var year = "";
                mydate = new Date();
                myweekday = mydate.getDay();
                mymonth = mydate.getMonth() + 1;
                myday = mydate.getDate();
                myyear = mydate.getYear();
                year = (myyear > 200) ? myyear : 1900 + myyear;
                if (myweekday == 0)
                    weekday = " 星期日";
                else if (myweekday == 1)
                    weekday = " 星期一";
                else if (myweekday == 2)
                    weekday = " 星期二";
                else if (myweekday == 3)
                    weekday = " 星期三";
                else if (myweekday == 4)
                    weekday = " 星期四";
                else if (myweekday == 5)
                    weekday = " 星期五";
                else if (myweekday == 6)
                    weekday = " 星期六";
                document.write(year + "年" + mymonth + "月" + myday + "日" + weekday);
            },
  • 相关阅读:
    [HNOI2004]L语言
    [TJOI2018]异或
    如何定位低效SQL?
    索引失效的情况有哪些?
    trace的作用?
    show profile的作用?
    索引的使用原则
    MySQL主从复制的步骤
    什么是聚簇索引
    什么是全文索引?
  • 原文地址:https://www.cnblogs.com/vvonline/p/4353158.html
Copyright © 2020-2023  润新知