jjzjj

GetValue

全部标签

JS时间对象与字符串相互转换

1、Date=>String代码/***函数描述:时间格式化工具*@paramformat{String}格式(y-年,M-月,d-日,H-时[24],h-时[12],m-分,s-秒,S-毫秒(3位数),q-季度,ap,午前am/午后pm)*@returns{String}*/Date.prototype.format=function(format){varo={'M+':this.getMonth()+1,//月份'd+':this.getDate(),//日'H+':this.getHours(),//时(24小时制)'h+':this.getHours()%12===0?12:this

JS时间对象与字符串相互转换

1、Date=>String代码/***函数描述:时间格式化工具*@paramformat{String}格式(y-年,M-月,d-日,H-时[24],h-时[12],m-分,s-秒,S-毫秒(3位数),q-季度,ap,午前am/午后pm)*@returns{String}*/Date.prototype.format=function(format){varo={'M+':this.getMonth()+1,//月份'd+':this.getDate(),//日'H+':this.getHours(),//时(24小时制)'h+':this.getHours()%12===0?12:this