/** * 时间戳转为 xxxx-xx-xx xx:xx:xx 格式 */ function formatTime(time) { var dateTime = new Date(time*1000); var year = dateTime.getFullYear(); var month = dateTime.getMonth() + 1; var date = dateTime.getDate(); var hour = dateTime.getHours(); var minute = dateTime.getMinutes(); var second = dateTime.getSeconds(); return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second; }