总秒数转时分秒

    fun(zms) {
      let h =
        Math.floor(zms / 3600) < 10
          ? "0" + Math.floor(zms / 3600)
          : Math.floor(zms / 3600);
      let m =
        Math.floor((zms / 60) % 60) < 10
          ? "0" + Math.floor((zms / 60) % 60)
          : Math.floor((zms / 60) % 60);
      let s =
        Math.floor(zms % 60) < 10
          ? "0" + Math.floor(zms % 60)
          : Math.floor(zms % 60);
      if (h == 0) {
        zms = m + "分钟" + s + "秒";
      } else {
        zms = h + "小时" + m + "分钟" + s + "秒";
      }
      return zms;
    },

 

posted @ 2022-11-07 17:44  QinHaoRan  阅读(57)  评论(0)    收藏  举报