本帖最后由 wwqisis 于 2013-08-16 14:24:25 编辑

解决方案 »

  1.   

    http://www.cnblogs.com/atree/archive/2011/06/29/JS-JavaScript-Date-Format.html
      

  2.   


    变量点Substring(0,10).Replace('/','-') ?
      

  3.   


    变量点Substring(0,10).Replace('/','-') ? var a = type[i]["SUBMITTIME"]
                                        alert(a);
                                        a = a.Substring(0, 10).Replace('/', '-');
                                        alert(a);
      

  4.   

    function test() {
    var str = "2006/04/04 14:20:34";
    var nowStr = new Date(str);
    alert(nowStr.format("yyyy-MM-dd"));
    }
    Date.prototype.format = function (format) {
    var o = {
    "M+": this.getMonth() + 1, //month
    "d+": this.getDate(), //day
    "h+": this.getHours(), //hour
    "m+": this.getMinutes(), //minute
    "s+": this.getSeconds(), //second
    "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
    "S": this.getMilliseconds() //millisecond
    };
    if (/(y+)/.test(format)) {
    format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    for (var k in o) {
    if (new RegExp("(" + k + ")").test(format)) {
    format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
    }
    }
    return format;
    };
    输出2006-04-04
      

  5.   

    这样是等于重写了日期的foramt