//小于10前面加0
function add(m){
return m<10 ? "0"+m : m;
}
function getTime(timestamp) {
var time = new Date(timestamp);
var year = time.getFullYear();
var month = time.getMonth()+1;
var day = time.getDate();
var hour = time.getHours();
var minutes = time.getMinutes();
var seconds = time.getSeconds();
return year +"-"+add(month)+"-"+add(day)+" "+add(hour)+":"+add(minutes)+":"+add(seconds);
}