var d = new Date();
d.setTime(1330912983320);
var year = d.getFullYear();
var month = d.getMonth()+1;
var date = d.getDate();
var hour = d.getHours();
var minute = d.getMinutes();
var second = d.getSeconds();
alert(year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second);
你可以在判断下如果月日时小于10前边加个0
这样试试:
var d = new Date();
d.setTime(77771564221);
document.write(d);