个人喜好的时间戳转换时间js
html的js中写入以下代码,引用
getLocalTime();
function getLocalTime(nS) {
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
}
在php中使用:
<script>
document.write(getLocalTime({$vo.update_time}));
</script>