zoukankan      html  css  js  c++  java
  • js 时间戳转时间格式

    $("#showbidMessage").append(<span>' + ChangeDateFormat(rows[i].createTime) + '</span>)         //调用

    //时间转换

    function ChangeDateFormat(val) {
    if (val != null) {
    var date = new Date(parseInt(val.replace("/Date(", "").replace(")/", ""), 10));
    //月份为0-11,所以+1,月份小于10时补个0
    var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
    var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();

    var hh = date.getHours(); //时
    var mm = date.getMinutes(); //分
    var ss = date.getSeconds();
    if (hh < 10) hh += "0";
    if (mm < 10) mm += '0';
    if (ss < 10) ss += '0';

    return date.getFullYear() + "-" + month + "-" + currentDate + " " + hh + ":" + mm + ":" + ss;
    }
    return "";
    }

  • 相关阅读:
    SKPhysicsJointPin类
    SKPhysicsJointLimit类
    SKPhysicsJointFixed类
    SKPhysicsJoint类
    SKPhysicsContact类
    SKPhysicsBody类
    SKLabelNode类
    SKNode类
    SKKeyframeSequence类
    Unique Paths II
  • 原文地址:https://www.cnblogs.com/reailcooker/p/9968108.html
Copyright © 2011-2022 走看看