alert(EDate< new Date().format("yyyy-MM-dd hh:mm:ss"));

 

 1 Date.prototype.format = function(format){ 
 2 var o = { 
 3 "M+" : this.getMonth()+1, //month 
 4 "d+" : this.getDate(), //day 
 5 "h+" : this.getHours(), //hour 
 6 "m+" : this.getMinutes(), //minute 
 7 "s+" : this.getSeconds(), //second 
 8 "q+" : Math.floor((this.getMonth()+3)/3), //quarter 
 9 "S" : this.getMilliseconds() //millisecond 
10 } 
11 
12 if(/(y+)/.test(format)) { 
13 format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
14 } 
15 
16 for(var k in o) { 
17 if(new RegExp("("+ k +")").test(format)) { 
18 format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length)); 
19 } 
20 } 
21 return format; 
22 } 
View Code

相关文章:

  • 2017-12-19
  • 2021-11-09
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-07-03
  • 2022-01-12
  • 2021-07-10
相关资源
相似解决方案