获取当前时间: var time = new Date();
获取指定时间戳的日期: var time = new Date(1234564684);
装换为正常日期格式: time.toLocaleString();
数字时间戳转换成日期格式方法:
function getLocalTime(nS){
return new Date(parseInt(nS) * 1000).toLocaleString().split(' ')[0].replace(/\//g,"-");
}

被折叠的 条评论
为什么被折叠?



