赞
踩
let datatime='20221102'; //转换成 2022-11-02
let formdata=datatime.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3")
console.log('formdata',formdata) //formdata 2022-11-02
let datatime2='2022-11-02';
let formdata2=formdata.replace(/-/g,"");
console.log('formdata2',formdata2)//formdata2 20221102
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。