let x = 2703750;//单位是秒 var d = moment.duration(x, 'seconds'); console.log(Math.floor(d.asDays()) + '天' + d.hours() + '时' + d.minutes() + '分' + d.seconds() + '秒');
输出结果为31天7时2分30秒
最大单位到天
let x = 2703750;//单位是秒 var d = moment.duration(x, 'seconds'); console.log(Math.floor(d.asDays()) + '天' + d.hours() + '时' + d.minutes() + '分' + d.seconds() + '秒');
输出结果为31天7时2分30秒
最大单位到天
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。