根据时间秒转换成天-小时-分钟-秒

// 秒转换成day、hour、minutes、seconds
  formatSecond(second: number) {
    const days = Math.floor(second / 86400);
    const hours = Math.floor((second % 86400) / 3600);
    const minutes = Math.floor(((second % 86400) % 3600) / 60);
    const seconds = Math.floor(((second % 86400) % 3600) % 60);
    const forMatDate = {
      days: days,
      hours: hours,
      minutes: minutes,
      seconds: seconds
    };
    return forMatDate;
  }

console.log(formatSecond(90)) // 0天0小时1分30秒

相关文章:

  • 2022-02-08
  • 2021-10-28
  • 2021-09-28
  • 2022-02-07
  • 2022-02-24
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-31
  • 2021-12-18
  • 2021-09-19
  • 2021-11-25
相关资源
相似解决方案