PHP
·
发表于 5年以前
·
阅读量:8290
/**
* timestamp:1469085472490
*/
var timestampToFormatDate = function(timestamp){
var date = new Date(); date.setTime(timestamp);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
return year + '-' + supplementZero(month,2) + '-' + supplementZero(day,2) + ' ' +
supplementZero(hour,2) + ':' + supplementZero(minute,2) + ':' + supplementZero(second,2);
}