js将"2018-05-19T08:04:52.000+0000"这种格式的时间转化为正常格式

版权声明:博客就当自己记的笔记而已~非常感谢博客大神的帮助,若有无意侵权,请联系我,谢谢 https://blog.csdn.net/qq_32963841/article/details/82761103
var time="2018-05-19T08:04:52.000+0000";
 var d = new Date(time);

var times=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds(); 

输出 2018-05-19 15:59:10

猜你喜欢

转载自blog.csdn.net/qq_32963841/article/details/82761103