function formatTime(timestamp){ var newDate = new Date(); newDate.setTime(timestamp); return newDate.toISOString().slice(0, 19).replace(‘T‘, ‘ ‘); }
formatTime(1496463169284); //2017-06-03 04:12:49
原文:http://www.cnblogs.com/John-blogs/p/6936938.html