functionformatTime(timeStamp){
timeStamp = parseInt(timeStamp);
var secShow = 60*1000;
var minShow = 60*60*1000;
var hourShow = 24*60*60*1000;
var dayShow = 30*24*60*60*1000;
var now = newDate().getTime();
var dis = now - timeStamp;
if(dis<secShow){
return dis/1000+'秒前';
}elseif(dis<minShow){
return dis/(1000*60) + '分钟前';
}elseif(dis<hourShow){
return dis/(1000*60*60) + '小时前';
}elseif(dis<dayShow){
return dis/(1000*60*60*24) + '天前';
}else {
var d = newDate(timeStamp);
var year = d.getFullYear();
var month = d.getMonth()+1;
var date = d.getDate();
var hour = d.getHours();
var min = d.getMinutes();
var sec = d.getSeconds();
return year+'-'+add0(month)+'-'+add0(date)+'<br/>'+add0(hour)+':'+add0(min)+':'+add0(sec);
}
}