第29天 [js]时间戳转换


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

相关