个人喜好的时间戳转换时间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>
posted @ 2018-02-07 19:10  吃西瓜不吐西瓜籽  阅读(149)  评论(0编辑  收藏  举报
Live2D