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>
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>
转载于:https://www.cnblogs.com/zlicon/p/8428086.html