Date.prototype.toString=function(){

  <script type="text/javascript" src="jquery/2.1.4/jquery.min.js"></script>
 </head>

 <body>
  <div id="output1" class=""> </div>
  <div id="output2" class=""> </div>
  <script type="text/javascript">
  var d1=new Date();
  $("#output1").html(d1);

  Date.prototype.toString=function(){
      return this.getFullYear() + "-" +(this.getMonth()+1) + "-"+this.getDate()
      +" "+this.getHours()+":"+this.getMinutes()+":"+this.getSeconds();
  }

  var d2=new Date();
  $("#output2").html(d2);

  </script>
Sun Nov 26 15:59:06 UTC+0800 2017

2017-11-26 15:59:6
 

 

posted @ 2017-11-26 16:01  sky20080101  阅读(108)  评论(0)    收藏  举报