Skip to main content

format_uptime

Function format_uptime 

Source
pub fn format_uptime(seconds: u64) -> String
Expand description

Format an uptime in seconds as "Xd Yh Zm" (or shorter when leading units are zero).

Examples:

  • 0"0m"
  • 59"0m"
  • 3600"1h"
  • 3660"1h 1m"
  • 86400"1d"
  • 90061"1d 1h 1m"