let time = '2021-8-21 18:48';
console.log(time);
console.log(time.replace(/\-/g, '/'));
time = time.replace(/\-/g, '/');
console.log(time);
let date = new Date(time);
console.log(date);
https://www.runoob.com/regexp/regexp-syntax.html
// 正则表达式匹配标签
let reg = new RegExp('<o:p>|</o:p>|<tr>|</tr>|<td>|</td>', 'g');
let regex = new RegExp('<span[^>]*>|</span>|<font[^>]*>|</font>|<img[^>]*>', 'g');
// 正则表达式添加变量
// let regex = new RegExp(sprnstr + '([\\s\\S]*?)' + eprnstr, 'i');
let showhtml = res.data.match(/<table width="95%" align="center" border="0" cellspacing="0" cellpadding="0">([\s\S]*?)<\/table>/i);
// let showhtml = res.data.match(regex);
//删除行内样式
let regex = new RegExp(' style="[^"]*"', 'g');
// let regexp = new RegExp('<p [^>]*>', 'g');
// let regexs = new RegExp('<span[^>]*>', 'g');
content = content.replace(regex, '');
// content = content.replace(regexp, '<p>').replace(regexs, '<span>');