js时间戳怎么转成日期格式
var date = new Date(new Date().getTime());
Y = date.getFullYear() + '-';
M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
D = date.getDate() + ' ';
h = date.getHours() + ':';
m = date.getMinutes() + ':';
s = date.getSeconds();
console.log(Y+M+D+h+m+s);
耐得住寂寞,才能登得顶
Gitee码云:https://gitee.com/lyc96/projects