js 14位字符串 转日期

const pattern = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/;
const newDate = new Date(timeEnd.replace(pattern, '$1-$2-$3 $4:$5:$6'));

  

猜你喜欢

转载自www.cnblogs.com/chendaoyin/p/10291963.html