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'));