2020
10-08
10-08
JS的时间格式化和时间戳转换函数示例详解
JS的时间格式化和时间戳转换函数//格式化时间functiondateFormat(fmt,date){varo={"M+":date.getMonth()+1,//月份"d+":date.getDate(),//日"h+":date.getHours(),//小时"m+":date.getMinutes(),//分"s+":date.getSeconds(),//秒"q+":Math.floor((date.getMonth()+3)/3),//季度"S":date.getMilliseconds()//毫秒};if(/(y+)/.test(fmt))fmt=fmt.replace(RegExp.$1,(date.getFullYear()...
继续阅读 >