数据库时间读取的格式按照 系统的个好似形式 读出来的
不管系统格式是什么  统一转换成mm/dd/yyyy 
怎么处理

解决方案 »

  1.   

     
               function TimeFormat(d) {
                   
                  var str =  (d.getMonth() + 1) + "/"
                   str +=  d.getDate() + " /"
                   str += d.getFullYear();
                   return str;
               }           alert(TimeFormat(new Date()));
      

  2.   

    data_format("规则"),好像是这个,记不清楚了~~
      

  3.   

    ///格式日期
     Date.prototype.format = function(format)
     {
         var o ={
                'M+' : this.getMonth()+1, //month
                'd+' : this.getDate(),    //day
                'h+' : this.getHours(),   //hour
                's+' : this.getSeconds(), //second
                'm+' : this.getMinutes(), //minute
                '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; 
     };alert(new Date().format('yyyy-MM-dd hh:mm:ss'));