How to use format() on a moment.js duration?

前端 未结 28 2297
自闭症患者
自闭症患者 2020-11-27 04:34

Is there any way I can use the moment.js format method on duration objects? I can\'t find it anywhere in the docs and it doesn\'t seen to be an attribute on du

28条回答
  •  天涯浪人
    2020-11-27 05:12

    moment.duration(x).format() has been deprecated. You can usemoment.utc(4366589).format("HH:mm:ss") to get the desired response.

    console.log(moment.utc(4366589).format("HH:mm:ss"))
    
    

提交回复
热议问题