• 格式化日期(月和星期)


    // /**
    // * 格式化日期(月和星期)
    // * sFormat:日期的格式(如yy-MM-dd)。年:y,月:M,日:d,时:h,分:m,秒:s
    // * sLanguage: 默认为中文。当为'en'的时候是英文。
    // */
    // window.dateFormat=function(date, sFormat, sLanguage){
    // var time = {};
    // time.Year = date.getFullYear();
    // time.TYear = ("" + time.Year).substr(2);
    // time.Month = date.getMonth() + 1;
    // time.TMonth = time.Month < 10 ? "0" + time.Month : time.Month;
    // time.Day = date.getDate();
    // time.TDay = time.Day < 10 ? "0" + time.Day : time.Day;
    // time.Hour = date.getHours();
    // time.THour = time.Hour < 10 ? "0" + time.Hour : time.Hour;
    // time.hour = time.Hour < 13 ? time.Hour : time.Hour;
    // time.Thour = time.hour < 10 ? "0" + time.hour : time.hour;
    // time.Minute = date.getMinutes();
    // time.TMinute = time.Minute < 10 ? "0" + time.Minute : time.Minute;
    // time.Second = date.getSeconds();
    // time.TSecond = time.Second < 10 ? "0" + time.Second : time.Second;
    // time.Millisecond = date.getMilliseconds();
    // time.Week = date.getDay();
    //
    // var MMMArrEn = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
    // MMMArr = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    // WeekArrEn = ["Sun", "Mon", "Tue", "Web", "Thu", "Fri", "Sat"],
    // WeekArr = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
    // oNumber = time.Millisecond / 1000;
    //
    // if (sFormat != undefined && sFormat.replace(/s/g, "").length > 0) {
    // if (sLanguage != undefined && sLanguage === "en") {
    // MMMArr = MMMArrEn.slice(0);
    // WeekArr = WeekArrEn.slice(0);
    // }
    // sFormat = sFormat.replace(/yyyy/ig, time.Year)
    // .replace(/yyy/ig, time.Year)
    // .replace(/yy/ig, time.TYear)
    // .replace(/y/ig, time.TYear)
    // .replace(/MMM/g, MMMArr[time.Month - 1])
    // .replace(/MM/g, time.TMonth)
    // .replace(/M/g, time.Month)
    // .replace(/dd/ig, time.TDay)
    // .replace(/d/ig, time.Day)
    // .replace(/HH/g, time.THour)
    // .replace(/H/g, time.Hour)
    // .replace(/hh/g, time.Thour)
    // .replace(/h/g, time.hour)
    // .replace(/mm/g, time.TMinute)
    // .replace(/m/g, time.Minute)
    // .replace(/ss/ig, time.TSecond)
    // .replace(/s/ig, time.Second)
    // .replace(/fff/ig, time.Millisecond)
    // .replace(/ff/ig, oNumber.toFixed(2) * 100)
    // .replace(/f/ig, oNumber.toFixed(1) * 10)
    // .replace(/EEE/g, WeekArr[time.Week]);
    // }else {
    // sFormat = time.Year + "-" + time.Month + "-" + time.Day + " " + time.Thour + ":" + time.TMinute + ":" + time.TSecond;
    // }
    // return sFormat;
    // };
  • 相关阅读:
    mybatis中的foreach条件参数过多时,#和$效率比较
    Error creating bean with name 'persistenceExceptionTranslationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfiguration
    ConfigurationProperties cannot be resolved to a type
    Java 注解 初探 (一)
    无题
    [转载]A cycle was detected in the build path of project
    20段代码
    在tomcat5中发布项目时,用IP地址+端口不能访问项目,而用localhost加端口时可以访问成功
    Cannot get connection for URL jdbc:oracle:thin:调用中无效参数
    mysql中表分类MyISAM和InnoDB的区别
  • 原文地址:https://www.cnblogs.com/annie211/p/7210453.html
Copyright © 2020-2023  润新知