js正则更换时间
function time(){
let reg = /(\d{4,})\/(\d{1,2})\/(\d{1,2})\s*(下午|上午)(\d{1,2})\:(\d{1,2})\:(\d{1,2})/
return new Date().toLocaleString().replace(reg,() =>`${RegExp.$1}-${RegExp.$2.padStart(2, "0")}-${RegExp.$3.padStart(2, "0")} ${RegExp.$4
原创
2020-12-15 18:18:59 ·
643 阅读 ·
0 评论