Get the time difference between two datetimes

前端 未结 19 1991
花落未央
花落未央 2020-11-22 05:25

I know I can do anything and some more envolving Dates with momentjs. But embarrassingly, I\'m having a hard time trying to do something that seems simple: geting the differ

19条回答
  •  难免孤独
    2020-11-22 06:00

    Instead of

    Math.floor(duration.asHours()) + moment.utc(duration.asMilliseconds()).format(":mm:ss")
    

    It's better to do

    moment.utc(total.asMilliseconds()).format("HH:mm:ss");
    

提交回复
热议问题