function getLocalTime(time){ if(time > 0){ var dateStr = new Date(time * 1000); var str = "" + dateStr.getFullYear() + "-"; var m = dateStr.getMonth(); m = m < 10 ? "0" + m : m; str += m +"-"; var d = dateStr.getDate(); d = d < 10 ? "0" + d : d; str += d +" "; var H = dateStr.getHours(); H = H < 10 ? "0" + H : H; str += H+":"; var i = dateStr.getMinutes(); i = i < 10 ? "0" + i : i; str += i+":"; var s = dateStr.getSeconds(); s = s < 10 ? "0" + s : s; str += s; return str; }else{ return ‘末知时间‘; } }
时间: 2024-10-07 20:03:05