JQuery 时间戳转时间
JQuery 时间戳转时间
var date = new Date(stocks[i]['create_time'] * 1000); var y = date.getFullYear(); var m = "00" + (date.getMonth() + 1).toString(); m = m.substr(m.length - 2); var d = "00" + (date.getDate()).toString(); d = d.substr(d.length - 2); var hour = "00" + date.getHours().toString(); hour = hour.substr(hour.length - 2); var minutes = "00" + date.getMinutes().toString(); minutes = minutes.substr(minutes.length - 2); var seconds = "00" + date.getSeconds().toString(); seconds = seconds.substr(seconds.length - 2);