第29天 [js]时间戳转换

function getLocalTime(nS) {  
    return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');  
   }
console.log(getLocalTime(1636387199));

  

 

posted @ 2021-11-16 15:57  Mr、DIVE  阅读(19)  评论(0编辑  收藏  举报