根据秒数自动转换天时分
下载moment jsnpm install moment --save # npmimport moument from 'moment' 根据秒数大小匹配对应的处理格式let timer = 3601var d = moment.duration(timer, 'seconds')// 小于 1 分钟if(timer<60) { console.log(d.seconds() + '秒')// 小于 1 小时} else if(timer<3600) {
原创
2022-04-26 10:23:39 ·
527 阅读 ·
0 评论