js 时间戳转为日期

1 function time(){    //页面时间戳转换成时间
2    $(".time").each(function(){
3         var time = $(this).text();
4         var times = new Date(parseInt(time)*1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");      
5          $(this).text(times);
6     });
7 }

posted @ 2015-08-08 10:17  微客鸟窝  阅读(140)  评论(0编辑  收藏  举报
/* 看板娘 */