标签:bsp eth return style gets console func min date()
function formatDate(now) { var year=now.getYear(); var month=now.getMonth()+1; var date=now.getDate(); var hour=now.getHours(); var minute=now.getMinutes(); var second=now.getSeconds(); return "20"+year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second; } var d=new Date(1508833784588);//时间戳 console.log(formatDate(d));//
js实现将时间戳转换成2017-05-11 15:11:02
标签:bsp eth return style gets console func min date()
原文地址:http://www.cnblogs.com/rockyan/p/7724353.html