1 unstable release

Uses new Rust 2024

0.1.1 Feb 20, 2025

#577 in Internationalization (i18n)

Download history 136/week @ 2025-02-19 8/week @ 2025-02-26 6/week @ 2025-03-05

150 downloads per month
Used in pg_

MulanPSL-2.0

11KB

hsec : human readable seconds

pub fn hsec(sec: u64) -> String {
  let minutes = sec / 60;
  if minutes < 99 {
    return format!("{} 分钟", minutes);
  }

  let hours = sec / 3600;
  if hours < 99 {
    return format!("{} 小时", hours);
  }

  format!("{}", sec / 86400)
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~135KB