Vue 将毫秒转换为天

  private formatDuring(mss) {
    let days = Math.floor(mss / (1000 * 60 * 60 * 24));
    let hours = Math.floor((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    let minutes = Math.floor((mss % (1000 * 60 * 60)) / (1000 * 60));
    let seconds = Math.round((mss % (1000 * 60)) / 1000);
    return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
  }

猜你喜欢

转载自blog.csdn.net/qq_34607371/article/details/86149699