方法var dateStr = '20180418230102'; var reg = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/; dateStr = dateStr.replace(reg, '$1-$2-$3 $4:$5:$6'); "2018-04-18 23:01:02" 最后修改:2021 年 11 月 10 日 © 允许规范转载 赞 1 如果觉得我的文章对你有用,请点个赞支持一下
3 条评论
看的我热血沸腾啊www.jiwenlaw.com
想想你的文章写的特别好https://www.ea55.com/
怎么收藏这篇文章?