时间处理 大大石 2020-01-19 115 阅读1分钟 function formatSecondsCN(seconds) { var h = Math.floor(seconds / 3600) var m = Math.floor((seconds / 60) % 60) var s = Math.floor(seconds % 60) return h || m || s ? `${h ? h + '时' : ''}${m ? m + '分' : ''}${s ? s + '秒' : ''}` : '0分' }