JS将字符串yyyyMMddHHmmss转Date

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/CGS_______/article/details/88865137
var dateString1 = "20190328112125";
var pattern = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/;
var formatedDate1 = dateString1.replace(pattern, '$1/$2/$3 $4:$5:$6');
var ddate1 = new Date(formatedDate1);

 

展开阅读全文

没有更多推荐了,返回首页